Index: openacs-4/contrib/obsolete-packages/bboard/bboard.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/bboard/bboard.info,v diff -u -r1.2 -r1.3 --- openacs-4/contrib/obsolete-packages/bboard/bboard.info 29 Jun 2001 20:32:48 -0000 1.2 +++ openacs-4/contrib/obsolete-packages/bboard/bboard.info 31 Oct 2001 20:42:07 -0000 1.3 @@ -1,5 +1,5 @@ - + Bboard @@ -46,8 +46,6 @@ - - @@ -182,12 +180,12 @@ - - - - - + + + + + Index: openacs-4/contrib/obsolete-packages/bboard/tcl/bboard-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/bboard/tcl/bboard-procs-oracle.xql,v diff -u -r1.3 -r1.4 --- openacs-4/contrib/obsolete-packages/bboard/tcl/bboard-procs-oracle.xql 19 Sep 2001 00:54:22 -0000 1.3 +++ openacs-4/contrib/obsolete-packages/bboard/tcl/bboard-procs-oracle.xql 31 Oct 2001 20:42:07 -0000 1.4 @@ -323,13 +323,13 @@ - + - update cr_revisions - set content = empty_blob() - where revision_id = :revision_id - returning content into :1 + update cr_revisions + set filename = :filename, + content_length = :size + where revision_id = :revision_id @@ -366,14 +366,14 @@ - + - update cr_revisions - set content = empty_blob() - where revision_id = :revision_id - returning content into :1 - + update cr_revisions + set filename = :filename, + content_length = :size + where revision_id = :revision_id + Index: openacs-4/contrib/obsolete-packages/bboard/tcl/bboard-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/bboard/tcl/bboard-procs-postgresql.xql,v diff -u -r1.3 -r1.4 --- openacs-4/contrib/obsolete-packages/bboard/tcl/bboard-procs-postgresql.xql 19 Sep 2001 00:54:22 -0000 1.3 +++ openacs-4/contrib/obsolete-packages/bboard/tcl/bboard-procs-postgresql.xql 31 Oct 2001 20:42:07 -0000 1.4 @@ -129,9 +129,8 @@ - - update cr_revisions - set content = :content + update cr_revisions + set content = '$content' where revision_id = :revision_id @@ -289,13 +288,12 @@ - + - - update cr_revisions - set lob = [set __lob_id [db_string get_lob_id "select empty_lob()"]] - where revision_id = :revision_id - + update cr_revisions + set content = :filename, + content_length = :size + where revision_id = :revision_id @@ -330,13 +328,12 @@ - + - - update cr_revisions - set lob = [set __lob_id [db_string get_lob_id "select empty_lob()"]] - where revision_id = :revision_id - + update cr_revisions + set content = :filename, + content_length = :size + where revision_id = :revision_id Index: openacs-4/contrib/obsolete-packages/bboard/tcl/bboard-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/bboard/tcl/bboard-procs.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/contrib/obsolete-packages/bboard/tcl/bboard-procs.tcl 27 Aug 2001 21:52:41 -0000 1.5 +++ openacs-4/contrib/obsolete-packages/bboard/tcl/bboard-procs.tcl 31 Oct 2001 20:42:07 -0000 1.6 @@ -814,13 +814,11 @@ select content_item.get_latest_revision(:file_id) as revision_id from dual } - - db_dml set_content { - update cr_revisions - set content = empty_blob() - where revision_id = :revision_id - returning content into :1 - } -blob_files [list $local_filename] + + set filename [cr_create_content_file $file_id $revision_id $local_filename] + set size [file size $local_filename] + + db_dml set_content_size "" } ad_proc -public bboard_attach_file { @@ -856,12 +854,10 @@ from dual } - db_dml set_content { - update cr_revisions - set content = empty_blob() - where revision_id = :revision_id - returning content into :1 - } -blob_files [list $local_filename] + set filename [cr_create_content_file $file_id $revision_id $local_filename] + set size [file size $local_filename] + + db_dml set_content_size "" } Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/attachment-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/contrib/obsolete-packages/bboard/www/attachment-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/contrib/obsolete-packages/bboard/www/attachment.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/bboard/www/attachment.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/contrib/obsolete-packages/bboard/www/attachment.tcl 29 Jun 2001 20:37:18 -0000 1.2 +++ openacs-4/contrib/obsolete-packages/bboard/www/attachment.tcl 31 Oct 2001 20:42:07 -0000 1.3 @@ -10,23 +10,7 @@ if [string equal [ad_parameter "AttachmentsEnabledP"] "t"] { ad_require_permission $file_id bboard_read_forum - - db_0or1row get_mime_type { - select mime_type - from cr_revisions - where revision_id = content_item.get_live_revision(:file_id) - } - - if ![info exists mime_type] { - ad_return_complaint 1 "The file_id does not refer to a valid file attachment." - } - - ReturnHeaders $mime_type - - db_write_blob get_file " - select content - from cr_revisions - where revision_id = content_item.get_live_revision($file_id)" + cr_write_content -item_id $file_id } else { ad_return_complaint 1 "Attachments are currently disabled" } Index: openacs-4/contrib/obsolete-packages/postcard/www/postcard-picture.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/postcard/www/postcard-picture.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/contrib/obsolete-packages/postcard/www/postcard-picture.tcl 21 Aug 2001 22:22:29 -0000 1.2 +++ openacs-4/contrib/obsolete-packages/postcard/www/postcard-picture.tcl 31 Oct 2001 20:42:07 -0000 1.3 @@ -10,6 +10,8 @@ {image_id:integer,notnull} } +# DRB: Someday this should be rewritten to use the content repository +# and its cr_write_content proc. ReturnHeaders [db_string mime_type { select mime_type Index: openacs-4/contrib/obsolete-packages/ticket-tracker/tcl/ttracker-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/ticket-tracker/tcl/ttracker-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/contrib/obsolete-packages/ticket-tracker/tcl/ttracker-procs.tcl 29 Jul 2001 23:16:50 -0000 1.2 +++ openacs-4/contrib/obsolete-packages/ticket-tracker/tcl/ttracker-procs.tcl 31 Oct 2001 20:42:07 -0000 1.3 @@ -116,7 +116,6 @@ set package_id [ad_conn package_id] } -ns_log Notice "Huh? $package_id" db_exec_plsql install { begin ttracker_util.install(:package_id); Index: openacs-4/packages/acs-content-repository/acs-content-repository.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/acs-content-repository.info,v diff -u -r1.14 -r1.15 --- openacs-4/packages/acs-content-repository/acs-content-repository.info 27 Sep 2001 22:48:16 -0000 1.14 +++ openacs-4/packages/acs-content-repository/acs-content-repository.info 31 Oct 2001 20:42:07 -0000 1.15 @@ -87,6 +87,8 @@ + + @@ -106,6 +108,7 @@ + Index: openacs-4/packages/acs-content-repository/tcl/revision-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/revision-procs-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-content-repository/tcl/revision-procs-oracle.xql 27 Apr 2001 02:27:09 -0000 1.1 +++ openacs-4/packages/acs-content-repository/tcl/revision-procs-oracle.xql 31 Oct 2001 20:42:07 -0000 1.2 @@ -28,4 +28,29 @@ + + + select r.mime_type, i.storage_type, i.storage_area_key, r.revision_id + from cr_revisions r, cr_items i + where i.item_id = r.item_id and + r.revision_id = content_item.get_live_revision(:item_id) + + + + + + select :path || filename + from cr_revisions + where revision_id = :revision_id + + + + + + select content + from cr_revisions + where revision_id = $revision_id + + + 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.2 -r1.3 --- openacs-4/packages/acs-content-repository/tcl/revision-procs-postgresql.xql 3 May 2001 04:00:49 -0000 1.2 +++ openacs-4/packages/acs-content-repository/tcl/revision-procs-postgresql.xql 31 Oct 2001 20:42:07 -0000 1.3 @@ -29,4 +29,28 @@ + + + select i.storage_type, i.storage_area_key, r.mime_type, r.revision_id + from cr_items i, cr_revisions r + where r.revision_id = content_item__get_live_revision(:item_id) and i.item_id = r.item_id + + + + + + select :path || content + from cr_revisions + where revision_id = :revision_id + + + + + + select lob as content + from cr_revisions + where revision_id = :revision_id + + + Index: openacs-4/packages/acs-content-repository/tcl/revision-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/revision-procs.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/acs-content-repository/tcl/revision-procs.tcl 9 May 2001 05:15:58 -0000 1.4 +++ openacs-4/packages/acs-content-repository/tcl/revision-procs.tcl 31 Oct 2001 20:42:07 -0000 1.5 @@ -18,3 +18,69 @@ return $revision_id } + +ad_proc -public cr_write_content { + -item_id + -revision_id +} { + + @param item_id the item to write + @param revision_id revision to write + @author Don Baccus (dhogaza@pacifier.com) + + Write out the specified content to the current HTML connection. Only one of + item_id and revision_id should be passed to this procedure. If item_id is + provided the item's live revision will be written, otherwise the specified + revision. + + This routine was was written to centralize the downloading of data from + the content repository. Previously, similar code was scattered among + various packages, not all of which were written to handle both in-database + and in-filesystem storage of content items. + + Though this routine is written to be fully general in terms of a content + item's storage type, typically those stored as text aren't simply dumped + to the user in raw form, but rather ran through the templating system + in order to surround the content with decorative HTML. + +} { + + if { [info exists revision_id] && [info exists item_id] } { + return -code error "Both revision_id and item_id were specfied" + } + + if { [info exists item_id] } { + if { ![db_0or1row get_item_info ""] } { + return -code error "There is no content that matches item_id '$item_id'" + } + } elseif { [info exists revision_id] } { + if { ![db_0or1row get_revision_info ""] } { + return -code error "There is no content that matches revision_id '$revision_id'" + } + } else { + return -code error "Either revision_id or item_id must be specified" + } + + if { ![string equal $storage_type "file"] && \ + ![string equal $storage_type "text"] && \ + ![string equal $storage_type "lob"] } { + return -code error "Storage type '$storage_type' is invalid." + } + + ReturnHeaders $mime_type + + switch $storage_type { + text { + ns_write [db_string write_text_content] + } + file { + set path [cr_fs_path $storage_area_key] + db_write_blob write_file_content "" + } + lob { + db_write_blob write_lob_content "" + } + } + + return +} 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.6 -r1.7 --- openacs-4/packages/acs-mail/tcl/acs-mail-procs-postgresql.xql 25 Oct 2001 23:49:20 -0000 1.6 +++ openacs-4/packages/acs-mail/tcl/acs-mail-procs-postgresql.xql 31 Oct 2001 20:42:07 -0000 1.7 @@ -8,7 +8,7 @@ begin return content_item__new( - 'acs-mail message $body_id'::varchar, -- new__name + varchar 'acs-mail message $body_id'::varchar, -- new__name null, -- new__parent_id null, -- new__item_id null, -- new__locale @@ -59,7 +59,7 @@ begin return content_item__new( - 'acs-mail message $body_id', -- new__name + varchar 'acs-mail message $body_id', -- new__name null, -- new__parent_id null, -- new__item_id null, -- new__locale Index: openacs-4/packages/acs-mail/tcl/acs-mail-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-mail/tcl/acs-mail-procs.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/acs-mail/tcl/acs-mail-procs.tcl 25 Oct 2001 23:49:20 -0000 1.6 +++ openacs-4/packages/acs-mail/tcl/acs-mail-procs.tcl 31 Oct 2001 20:42:07 -0000 1.7 @@ -86,7 +86,7 @@ set item_id [db_exec_plsql insert_new_content " begin return content_item__new( - 'acs-mail message $body_id', -- new__name + varchar 'acs-mail message $body_id', -- new__name null, -- new__parent_id null, -- new__item_id null, -- new__locale @@ -139,7 +139,7 @@ set item_id [db_exec_plsql insert_new_content " begin return content_item__new( - 'acs-mail message $body_id', -- new__name + varchar 'acs-mail message $body_id', -- new__name null, -- new__parent_id null, -- new__item_id null, -- new__locale Index: openacs-4/packages/acs-messaging/sql/oracle/acs-messaging-packages.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-messaging/sql/oracle/acs-messaging-packages.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-messaging/sql/oracle/acs-messaging-packages.sql 5 Apr 2001 18:23:38 -0000 1.1 +++ openacs-4/packages/acs-messaging/sql/oracle/acs-messaging-packages.sql 31 Oct 2001 20:42:07 -0000 1.2 @@ -87,7 +87,8 @@ creation_date in acs_objects.creation_date%TYPE default sysdate, creation_user in acs_objects.creation_user%TYPE default null, creation_ip in acs_objects.creation_ip%TYPE default null, - is_live in char default 't' + is_live in char default 't', + storage_type in cr_items.storage_type%TYPE default 'file' ) return acs_objects.object_id%TYPE; function edit_file ( @@ -119,7 +120,8 @@ creation_date in acs_objects.creation_date%TYPE default sysdate, creation_user in acs_objects.creation_user%TYPE default null, creation_ip in acs_objects.creation_ip%TYPE default null, - is_live in char default 't' + is_live in char default 't', + storage_type in cr_items.storage_type%TYPE default 'file' ) return acs_objects.object_id%TYPE; function edit_image ( @@ -391,7 +393,8 @@ creation_date in acs_objects.creation_date%TYPE default sysdate, creation_user in acs_objects.creation_user%TYPE default null, creation_ip in acs_objects.creation_ip%TYPE default null, - is_live in char default 't' + is_live in char default 't', + storage_type in cr_items.storage_type%TYPE default 'file' ) return acs_objects.object_id%TYPE is v_file_id cr_items.item_id%TYPE; @@ -404,7 +407,8 @@ item_id => file_id, creation_date => creation_date, creation_user => creation_user, - creation_ip => creation_ip + creation_ip => creation_ip, + storage_type => storage_type ); -- create an initial revision for the new attachment @@ -477,7 +481,8 @@ creation_date in acs_objects.creation_date%TYPE default sysdate, creation_user in acs_objects.creation_user%TYPE default null, creation_ip in acs_objects.creation_ip%TYPE default null, - is_live in char default 't' + is_live in char default 't', + storage_type in cr_items.storage_type%TYPE default 'file' ) return acs_objects.object_id%TYPE is v_image_id cr_items.item_id%TYPE; @@ -490,7 +495,8 @@ item_id => image_id, creation_date => creation_date, creation_user => creation_user, - creation_ip => creation_ip + creation_ip => creation_ip, + storage_type => storage_type ); -- create an initial revision for the new attachment Index: openacs-4/packages/acs-subsite/www/shared/portrait-bits.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/shared/portrait-bits.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-subsite/www/shared/portrait-bits.tcl 13 Mar 2001 22:59:26 -0000 1.1 +++ openacs-4/packages/acs-subsite/www/shared/portrait-bits.tcl 31 Oct 2001 20:42:07 -0000 1.2 @@ -8,20 +8,10 @@ user_id:integer } -if ![db_0or1row get_item_id "select cr.revision_id, c.item_id, mime_type -from acs_rels a, cr_items c, cr_revisions cr -where a.object_id_two = c.item_id -and c.live_revision = cr.revision_id -and a.object_id_one = :user_id -and a.rel_type = 'user_portrait_rel'"] { +if { ![db_0or1row get_item_id ""] } { ad_return_error "Couldn't find portrait" "Couldn't find a portrait for User $user_id" return } -ReturnHeaders $mime_type +cr_write_content -item_id $item_id -db_write_blob output_portrait "select content -from cr_revisions -where revision_id = $revision_id" - - Index: openacs-4/packages/acs-subsite/www/user/portrait/upload-2-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/user/portrait/Attic/upload-2-postgresql.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-subsite/www/user/portrait/upload-2-postgresql.xql 3 May 2001 04:00:49 -0000 1.2 +++ openacs-4/packages/acs-subsite/www/user/portrait/upload-2-postgresql.xql 31 Oct 2001 20:42:07 -0000 1.3 @@ -6,7 +6,7 @@ select content_item__new( - :name, + varchar :name, null, null, null, Index: openacs-4/packages/acs-tcl/tcl/apm-file-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/apm-file-procs-postgresql.xql,v diff -u -r1.12 -r1.13 --- openacs-4/packages/acs-tcl/tcl/apm-file-procs-postgresql.xql 1 Sep 2001 18:18:09 -0000 1.12 +++ openacs-4/packages/acs-tcl/tcl/apm-file-procs-postgresql.xql 31 Oct 2001 20:42:07 -0000 1.13 @@ -7,7 +7,7 @@ select content_item__new( - :name, + varchar :name, null, null, null, Index: openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl 31 Oct 2001 20:42:07 -0000 1.2 @@ -1142,19 +1142,25 @@ Text to html does ad_text_to_html, and html to text does a ad_html_to_text. See those procs for details. + DRB: Modified this to accept mime types (text/plain or text/html). Simplies things when + providing confirmation pages for input destined for the content repository ... + @param from specify with html or text what type of text you're providing. @param to specify what format you want this translated into @author Lars Pind (lars@pinds.com) @creation-date 19 July 2000 } { switch $from { + text/html - html { switch $to { + text/html - html { ad_html_security_check $text return [util_close_html_tags $text] } + text/plain - text { return [ad_html_to_text -- $text] } @@ -1163,11 +1169,14 @@ } } } + text/plain - text { switch $to { + text/html - html { return [ad_text_to_html -- $text] } + text/plain - text { return [wrap_string $text 70] } Index: openacs-4/packages/cms/cms.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/cms.info,v diff -u -r1.6 -r1.7 --- openacs-4/packages/cms/cms.info 26 Aug 2001 22:57:00 -0000 1.6 +++ openacs-4/packages/cms/cms.info 31 Oct 2001 20:42:07 -0000 1.7 @@ -1,5 +1,5 @@ - + Content Management System @@ -20,10 +20,10 @@ + - @@ -290,7 +290,6 @@ - @@ -830,11 +829,11 @@ - - - - + + + + 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.16 -r1.17 --- openacs-4/packages/cms/tcl/form-procs-postgresql.xql 21 Sep 2001 05:01:38 -0000 1.16 +++ openacs-4/packages/cms/tcl/form-procs-postgresql.xql 31 Oct 2001 20:42:07 -0000 1.17 @@ -163,7 +163,7 @@ - select content_item__new(:name, + select content_item__new(varchar :name, :parent_id, :item_id, :locale, Index: openacs-4/packages/cms/www/item/create-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/item/create-postgresql.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/cms/www/item/create-postgresql.xql 8 Jun 2001 01:44:53 -0000 1.2 +++ openacs-4/packages/cms/www/item/create-postgresql.xql 31 Oct 2001 20:42:07 -0000 1.3 @@ -6,7 +6,7 @@ - select content_item__new(:name, + select content_item__new(varchar :name, :context_id, :item_id, null, Index: openacs-4/packages/cms/www/modules/items/content-download-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/content-download-oracle.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/cms/www/modules/items/content-download-oracle.xql 2 Sep 2001 12:26:05 -0000 1.2 +++ openacs-4/packages/cms/www/modules/items/content-download-oracle.xql 31 Oct 2001 20:42:07 -0000 1.3 @@ -3,20 +3,6 @@ oracle8.1.6 - - - - select - [ad_decode $storage_type file "'[cr_fs_path]' || filename" content] as content - from - cr_revisions - where - revision_id = $revision_id - - - - - @@ -29,6 +15,5 @@ - 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.4 -r1.5 --- openacs-4/packages/cms/www/modules/items/content-download-postgresql.xql 30 Aug 2001 01:46:05 -0000 1.4 +++ openacs-4/packages/cms/www/modules/items/content-download-postgresql.xql 31 Oct 2001 20:42:07 -0000 1.5 @@ -2,26 +2,6 @@ postgresql7.1 - - - - - select - case when i.storage_type = 'file' - 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 - revision_id = $revision_id - - - - Index: openacs-4/packages/cms/www/modules/items/content-download.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/content-download.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/cms/www/modules/items/content-download.tcl 2 Sep 2001 12:26:05 -0000 1.3 +++ openacs-4/packages/cms/www/modules/items/content-download.tcl 31 Oct 2001 20:42:07 -0000 1.4 @@ -1,71 +1,29 @@ # download.tcl # # see if this person is authorized to read the file in question -# guess the MIME type from the original client filename -# have the Oracle driver grab the BLOB and write it to the connection +# and if so, write it to the connection. - template::request create template::request set_param revision_id -datatype integer set user_id [User::getID] template::query get_iteminfo iteminfo onerow " select - item_id, mime_type, content_revision.is_live( revision_id ) is_live + item_id, content_revision.is_live( revision_id ) is_live from cr_revisions where revision_id = :revision_id " template::util::array_to_vars iteminfo -# item_id, mime_type, is_live +# item_id, is_live + # check cm permissions on file if { ![string equal $is_live t] } { content::check_access $item_id cm_read -user_id $user_id } -db_1row get_filename " - select - name as file_name, - storage_type, - from - cr_items - where - item_id = ( select - item_id - from - cr_revisions - where - revision_id = :revision_id ) -" - - - -set headers_so_far "HTTP/1.0 200 OK -MIME-Version: 1.0 -Content-Type: $mime_type\n" - -set set_headers_i 0 -set set_headers_limit [ns_set size [ns_conn outputheaders]] -while {$set_headers_i < $set_headers_limit} { - append headers_so_far \ - "[ns_set key [ns_conn outputheaders] $set_headers_i]: [ns_set value [ns_conn outputheaders] $set_headers_i]\n" - incr set_headers_i -} -append entire_string_to_write $headers_so_far "\n" -ns_write $entire_string_to_write - -db_write_blob write_content " - select - content - from - cr_revisions - where - revision_id = $revision_id -" - - - +cr_write_content -revision_id $revision_id Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/items/content-download.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/cms/www/modules/items/revision-upload-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/revision-upload-postgresql.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/cms/www/modules/items/revision-upload-postgresql.xql 8 Jun 2001 01:44:53 -0000 1.3 +++ openacs-4/packages/cms/www/modules/items/revision-upload-postgresql.xql 31 Oct 2001 20:42:07 -0000 1.4 @@ -7,7 +7,7 @@ select content_item__new( - :name, + varchar :name, :parent_id, null, now(), Index: openacs-4/packages/download/tcl/download-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/tcl/download-procs-oracle.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/download/tcl/download-procs-oracle.xql 23 May 2001 16:35:55 -0000 1.3 +++ openacs-4/packages/download/tcl/download-procs-oracle.xql 31 Oct 2001 20:42:07 -0000 1.4 @@ -29,17 +29,7 @@ - - - - select content - from cr_revisions - where revision_id = $revision_id - - - - Index: openacs-4/packages/download/tcl/download-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/tcl/download-procs-postgresql.xql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/download/tcl/download-procs-postgresql.xql 22 May 2001 04:18:16 -0000 1.5 +++ openacs-4/packages/download/tcl/download-procs-postgresql.xql 31 Oct 2001 20:42:07 -0000 1.6 @@ -30,21 +30,6 @@ - - - - - -select '[cr_fs_path]' || content as content, storage_type -from cr_revisions r, cr_items i -where r.revision_id = :revision_id and - r.item_id = i.item_id - - - - - - Index: openacs-4/packages/download/tcl/download-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/tcl/download-procs.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/download/tcl/download-procs.tcl 23 May 2001 16:35:55 -0000 1.5 +++ openacs-4/packages/download/tcl/download-procs.tcl 31 Oct 2001 20:42:07 -0000 1.6 @@ -170,19 +170,8 @@ } } - db_1row file_type " - select mime_type - from cr_revisions - where revision_id = :revision_id" + cr_write_content -revision_id $revision_id - ReturnHeaders $mime_type - - db_write_blob version_write "select content - from cr_revisions - where revision_id = $revision_id" - - - return filter_return } Index: openacs-4/packages/download/tcl/download-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/tcl/download-procs.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/download/tcl/download-procs.xql 22 May 2001 04:18:16 -0000 1.2 +++ openacs-4/packages/download/tcl/download-procs.xql 31 Oct 2001 20:42:07 -0000 1.3 @@ -36,8 +36,6 @@ - - @@ -47,20 +45,6 @@ - - - - - -select mime_type -from cr_revisions -where revision_id = :revision_id - - - - - - Index: openacs-4/packages/download/www/archive-add-2-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/archive-add-2-postgresql.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/download/www/archive-add-2-postgresql.xql 14 May 2001 20:31:42 -0000 1.3 +++ openacs-4/packages/download/www/archive-add-2-postgresql.xql 31 Oct 2001 20:42:07 -0000 1.4 @@ -11,6 +11,7 @@ v_live_archive_desc_id integer; v_id integer; v_name cr_items.name%TYPE; + v_archive_name cr_items.name%TYPE; begin v_name := 'Download Archive Desc for ' || :archive_id; @@ -47,7 +48,7 @@ (v_live_archive_desc_id); v_archive_id := content_item__new( - :archive_name, + varchar :archive_name, :repository_id, :archive_id, null, Index: openacs-4/packages/download/www/one-archive.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/one-archive.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/download/www/one-archive.tcl 9 Jul 2001 15:34:59 -0000 1.3 +++ openacs-4/packages/download/www/one-archive.tcl 31 Oct 2001 20:42:07 -0000 1.4 @@ -60,12 +60,12 @@ set gc_link "" set gc_comments "" if { [catch { - set gc_link [general_comments::create_link $archive_id $archive_name [ad_conn url]?[ad_conn query] "Add a comment"] - set gc_comments [general_comments::get_comments $archive_id [ad_conn url]?[ad_conn query]] + set gc_link [general_comments_create_link -object_name $archive_name $archive_id [ad_conn url]?[ad_conn query]] + set gc_comments [general_comments_get_comments $archive_id [ad_conn url]?[ad_conn query]] } error] } { global errorInfo errorCode ns_log Notice "gc_link: $errorInfo, $errorCode" } -ad_return_template \ No newline at end of file +ad_return_template Index: openacs-4/packages/download/www/one-revision.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/one-revision.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/download/www/one-revision.tcl 9 Jul 2001 15:35:11 -0000 1.5 +++ openacs-4/packages/download/www/one-revision.tcl 31 Oct 2001 20:42:07 -0000 1.6 @@ -73,8 +73,8 @@ set gc_link "" set gc_comments "" if { [catch { - set gc_link [general_comments::create_link $revision_id "$archive_name $version_name" [ad_conn url]?[ad_conn query] "Add a comment"] - set gc_comments [general_comments::get_comments $revision_id [ad_conn url]?[ad_conn query]] + set gc_link [general_comments_create_link -object_name "$archive_name $version_name" $revision_id [ad_conn url]?[ad_conn query]] + set gc_comments [general_comments_get_comments $revision_id [ad_conn url]?[ad_conn query]] } error] } { global errorInfo errorCode ns_log Notice "gc_link: $errorInfo, $errorCode" Index: openacs-4/packages/file-storage/file-storage.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/file-storage.info,v diff -u -r1.5 -r1.6 --- openacs-4/packages/file-storage/file-storage.info 22 Sep 2001 05:36:57 -0000 1.5 +++ openacs-4/packages/file-storage/file-storage.info 31 Oct 2001 20:42:07 -0000 1.6 @@ -36,10 +36,7 @@ - - - @@ -117,8 +114,8 @@ - + Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/packages/file-storage/www/download/index-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/packages/file-storage/www/download/index-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/file-storage/www/download/index.vuh =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/download/index.vuh,v diff -u -r1.2 -r1.3 --- openacs-4/packages/file-storage/www/download/index.vuh 22 Sep 2001 05:41:18 -0000 1.2 +++ openacs-4/packages/file-storage/www/download/index.vuh 31 Oct 2001 20:42:07 -0000 1.3 @@ -5,57 +5,15 @@ Virtual URL handler for file downloads @author Kevin Scaldeferri (kevin@arsdigita.com) + @author Don Baccus (simplified it by using cr utility) @creation-date 18 December 2000 @cvs-id $Id$ } { - {version_id:integer ""} + version_id:integer } set user_id [ad_conn user_id] -# There is really no point in resolving the live_revision from the path, -# since we can always pass the live_revision id! -# -#regexp "[ad_conn package_url]download/(.*)" [ad_conn url] match path -# -#if [empty_string_p $version_id] { -# if ![db_0or1row get_file_id " -# select content_item.get_live_revision(content_item.get_id(:path,file_storage.get_root_folder([ad_conn package_id]))) as version_id from dual"] { -# ad_script_abort -# } -#} - ad_require_permission $version_id "read" -#set indb_p [ad_parameter "StoreFilesInDatabaseP" -package_id [ad_conn package_id]] -# We get the storage type from the way CR stored the file, instead of -# querying the package instance parameter. With this, we still are able -# to offer download of the file even if the site-admin mistakenly -# changes the storage type parameter after files are already stored in CR -db_1row file_type " -select mime_type,(case when lob is null then 0 - else 1 - end) as indb_p -from cr_revisions -where revision_id = :version_id" - -ReturnHeaders $mime_type - -if {$indb_p} { - - db_write_blob version_write_blob "select content - from cr_revisions - where revision_id = $version_id" -} else { - - # JS: I promise to make this cleaner... - set storage_type "file" - - db_write_blob version_write_file " - select '[cr_fs_path]' || filename as content - from cr_revisions - where revision_id = $version_id" -} - - - +cr_write_content -revision_id $version_id Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/packages/file-storage/www/download/index.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/general-comments/general-comments.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/general-comments/general-comments.info,v diff -u -r1.3 -r1.4 --- openacs-4/packages/general-comments/general-comments.info 14 Jun 2001 19:52:22 -0000 1.3 +++ openacs-4/packages/general-comments/general-comments.info 31 Oct 2001 20:42:07 -0000 1.4 @@ -1,5 +1,5 @@ - + General Comments @@ -78,18 +78,29 @@ + + + + + + + + + + + @@ -108,6 +119,7 @@ + Index: openacs-4/packages/general-comments/tcl/general-comments-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/general-comments/tcl/general-comments-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/general-comments/tcl/general-comments-procs.tcl 14 Jun 2001 19:38:05 -0000 1.2 +++ openacs-4/packages/general-comments/tcl/general-comments-procs.tcl 31 Oct 2001 20:42:07 -0000 1.3 @@ -175,6 +175,7 @@ if { ![info exists context_id] } { set context_id $object_id } set html "$link_text" + return $html } Index: openacs-4/packages/general-comments/www/comment-add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/general-comments/www/comment-add-2.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/general-comments/www/comment-add-2.tcl 14 Jun 2001 19:52:22 -0000 1.2 +++ openacs-4/packages/general-comments/www/comment-add-2.tcl 31 Oct 2001 20:42:07 -0000 1.3 @@ -12,14 +12,14 @@ { object_name "[acs_object_name $object_id]" } title:notnull content:html,notnull - { mime_type {text/plain} } + comment_mime_type:notnull { context_id "$object_id" } { category {} } { return_url {} } } -properties { page_title:onevalue context_bar:onevalue - mime_type:onevalue + comment_mime_type:onevalue title:onevalue content:onevalue target:onevalue @@ -43,5 +43,6 @@ set page_title "Confirm comment on $object_name" set context_bar {"Confirm comment"} set target "comment-add-3" +set html_content [ad_html_text_convert -from $comment_mime_type $content] ad_return_template "comment-ae-2" Index: openacs-4/packages/general-comments/www/comment-add-3-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/general-comments/www/Attic/comment-add-3-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/general-comments/www/comment-add-3-oracle.xql 14 Jun 2001 19:52:22 -0000 1.1 +++ openacs-4/packages/general-comments/www/comment-add-3-oracle.xql 31 Oct 2001 20:42:07 -0000 1.2 @@ -10,7 +10,7 @@ :1 := acs_message.new ( message_id => :comment_id, title => :title, - mime_type => :mime_type, + mime_type => :comment_mime_type, data => empty_blob(), context_id => :context_id, creation_user => :user_id, Index: openacs-4/packages/general-comments/www/comment-add-3-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/general-comments/www/Attic/comment-add-3-postgresql.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/general-comments/www/comment-add-3-postgresql.xql 17 Jul 2001 19:11:32 -0000 1.2 +++ openacs-4/packages/general-comments/www/comment-add-3-postgresql.xql 31 Oct 2001 20:42:07 -0000 1.3 @@ -5,18 +5,15 @@ - declare - v_message_id integer; - begin - select acs_message__new ( + select acs_message__new ( :comment_id, -- 1 p_message_id NULL, -- 2 p_reply_to current_timestamp, -- 3 p_sent_date NULL, -- 4 p_sender NULL, -- 5 p_rfc822_id :title, -- 6 p_title NULL, -- 7 p_description - :mime_type, -- 8 p_mime_type + :comment_mime_type, -- 8 p_mime_type NULL, -- 9 p_text NULL, -- empty_blob(), -- 10 p_data 0, -- 11 p_parent_id @@ -25,12 +22,7 @@ :creation_ip, -- 14 p_creation_ip 'acs_message', -- 15 p_object_type :is_live -- 16 p_is_live - ) into v_message_id; - - return v_message_id; - - end; - + ) Index: openacs-4/packages/general-comments/www/comment-add-3.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/general-comments/www/comment-add-3.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/general-comments/www/comment-add-3.tcl 14 Jun 2001 19:52:22 -0000 1.2 +++ openacs-4/packages/general-comments/www/comment-add-3.tcl 31 Oct 2001 20:42:07 -0000 1.3 @@ -12,7 +12,7 @@ object_id:integer,notnull title:notnull content:html,notnull - { mime_type "text/plain" } + comment_mime_type { context_id "$object_id" } { category "" } { return_url "" } @@ -33,7 +33,7 @@ :1 := acs_message.new ( message_id => :comment_id, title => :title, - mime_type => :mime_type, + mime_type => :comment_mime_type, data => empty_blob(), context_id => :context_id, creation_user => :user_id, Index: openacs-4/packages/general-comments/www/comment-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/general-comments/www/comment-add.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/general-comments/www/comment-add.tcl 14 Jun 2001 19:52:22 -0000 1.2 +++ openacs-4/packages/general-comments/www/comment-add.tcl 31 Oct 2001 20:42:07 -0000 1.3 @@ -19,7 +19,7 @@ target:onevalue title:onevalue content:onevalue - mime_type:onevalue + comment_mime_type:onevalue object_id:onevalue object_name:onevalue context_id:onevalue @@ -42,7 +42,7 @@ set target "comment-add-2" set title "" set content "" -set mime_type "text/plain" +set comment_mime_type "text/plain" ad_return_template "comment-ae" Index: openacs-4/packages/general-comments/www/comment-ae-2.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/general-comments/www/comment-ae-2.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/general-comments/www/comment-ae-2.adp 20 Apr 2001 20:51:11 -0000 1.1 +++ openacs-4/packages/general-comments/www/comment-ae-2.adp 31 Oct 2001 20:42:07 -0000 1.2 @@ -4,30 +4,25 @@ Here is how your comment would appear: - -
-

@title@

- @content@ -
+
+

@title@

+@html_content@ +
+ Note: if the text above has lost all of its paragraph breaks then you probably should have selected "Plain Text" rather than HTML. Use your browser's Back button to return to the submission form. -
-

@title@

- <%= [util_convert_plaintext_to_html $content] %> -
- Note: if the text above has a bunch of visible HTML tags then you probably should have selected "HTML" rather than "Plain Text". Use your browser's Back button to return to the submission form.
-<%= [export_form_vars comment_id object_id object_name context_id title content mime_type category return_url] %> +<%= [export_form_vars comment_id object_id object_name context_id title content comment_mime_type category return_url] %>
Index: openacs-4/packages/general-comments/www/comment-ae.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/general-comments/www/Attic/comment-ae.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/general-comments/www/comment-ae.adp 20 Apr 2001 20:51:11 -0000 1.1 +++ openacs-4/packages/general-comments/www/comment-ae.adp 31 Oct 2001 20:42:07 -0000 1.2 @@ -13,9 +13,8 @@ Comment:

Text above is - + Index: openacs-4/packages/general-comments/www/comment-edit-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/general-comments/www/comment-edit-2.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/general-comments/www/comment-edit-2.tcl 14 Jun 2001 19:52:22 -0000 1.2 +++ openacs-4/packages/general-comments/www/comment-edit-2.tcl 31 Oct 2001 20:42:07 -0000 1.3 @@ -18,7 +18,7 @@ object_id:integer,notnull title:notnull content:notnull,html - {mime_type "text/plain"} + comment_mime_type { return_url {} } } -properties { page_title:onevalue @@ -36,6 +36,8 @@ set context_bar {"Confirm comment"} set target "comment-edit-3" +set html_content [ad_html_text_convert -from $comment_mime_type $content] + ad_return_template "comment-ae-2" Index: openacs-4/packages/general-comments/www/comment-edit-3-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/general-comments/www/comment-edit-3-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/general-comments/www/comment-edit-3-oracle.xql 14 Jun 2001 19:52:22 -0000 1.1 +++ openacs-4/packages/general-comments/www/comment-edit-3-oracle.xql 31 Oct 2001 20:42:07 -0000 1.2 @@ -10,7 +10,7 @@ :1 := acs_message.edit ( message_id => :comment_id, title => :title, - mime_type => :mime_type, + mime_type => :comment_mime_type, data => empty_blob(), creation_user => :user_id, creation_ip => :creation_ip, Index: openacs-4/packages/general-comments/www/comment-edit-3-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/general-comments/www/comment-edit-3-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/general-comments/www/comment-edit-3-postgresql.xql 14 Jun 2001 19:52:22 -0000 1.1 +++ openacs-4/packages/general-comments/www/comment-edit-3-postgresql.xql 31 Oct 2001 20:42:07 -0000 1.2 @@ -12,7 +12,7 @@ /* message_id => */ :comment_id, /* title => */ :title, /* p_description */ NULL, - /* mime_type => */ :mime_type, + /* mime_type => */ :comment_mime_type, /* text */ NULL, /* data => */ NULL, -- was empty_blob(), /* creation_date */ now(), Index: openacs-4/packages/general-comments/www/comment-edit-3.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/general-comments/www/comment-edit-3.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/general-comments/www/comment-edit-3.tcl 14 Jun 2001 19:52:22 -0000 1.2 +++ openacs-4/packages/general-comments/www/comment-edit-3.tcl 31 Oct 2001 20:42:07 -0000 1.3 @@ -11,7 +11,7 @@ comment_id:integer,notnull title content:html - { mime_type "text/plain" } + comment_mime_type { return_url {} } } @@ -30,7 +30,7 @@ :1 := acs_message.edit ( message_id => :comment_id, title => :title, - mime_type => :mime_type, + mime_type => :comment_mime_type, data => empty_blob(), creation_user => :user_id, creation_ip => :creation_ip, Index: openacs-4/packages/general-comments/www/comment-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/general-comments/www/comment-edit.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/general-comments/www/comment-edit.tcl 14 Jun 2001 19:52:22 -0000 1.2 +++ openacs-4/packages/general-comments/www/comment-edit.tcl 31 Oct 2001 20:42:07 -0000 1.3 @@ -19,7 +19,7 @@ target:onevalue title:onevalue content:onevalue - mime_type:onevalue + comment_mime_type:onevalue comment_id:onevalue revision_id:onevalue return_url:onevalue @@ -40,7 +40,7 @@ select g.object_id, r.title, r.content, - r.mime_type + r.mime_type as comment_mime_type from general_comments g, cr_revisions r where g.comment_id = :comment_id and Index: openacs-4/packages/general-comments/www/comment-edit.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/general-comments/www/comment-edit.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/general-comments/www/comment-edit.xql 14 Jun 2001 19:52:22 -0000 1.1 +++ openacs-4/packages/general-comments/www/comment-edit.xql 31 Oct 2001 20:42:07 -0000 1.2 @@ -7,7 +7,7 @@ select g.object_id, r.title, r.content, - r.mime_type + r.mime_type as comment_mime_type from general_comments g, cr_revisions r where g.comment_id = :comment_id and Index: openacs-4/packages/general-comments/www/delete-attachment-2-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/general-comments/www/delete-attachment-2-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/general-comments/www/delete-attachment-2-postgresql.xql 14 Jun 2001 19:52:22 -0000 1.1 +++ openacs-4/packages/general-comments/www/delete-attachment-2-postgresql.xql 31 Oct 2001 20:42:07 -0000 1.2 @@ -27,25 +27,17 @@ - FIX ME PLSQL -FIX ME PLSQL - begin - acs_message__delete_image(:attach_id); - end; + select acs_message__delete_image(:attach_id); - FIX ME PLSQL -FIX ME PLSQL - begin - acs_message__delete_file(:attach_id); - end; + select acs_message__delete_file(:attach_id); Index: openacs-4/packages/general-comments/www/file-add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/general-comments/www/file-add-2.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/general-comments/www/file-add-2.tcl 14 Jun 2001 19:52:22 -0000 1.2 +++ openacs-4/packages/general-comments/www/file-add-2.tcl 31 Oct 2001 20:42:07 -0000 1.3 @@ -27,18 +27,18 @@ } } check_file_size { - set tmp_filename ${upload_file.tmpfile} - set n_bytes [file size $tmp_filename] + set tmp_size [file size ${upload_file.tmpfile}] set max_file_size [ad_parameter MaxFileSize {general-comments} {0}] - if { $n_bytes > $max_file_size && $max_file_size > 0 } { + if { $tmp_size > $max_file_size && $max_file_size > 0 } { ad_complain "Your file is too large. The publisher of [ad_system_name] has chosen to limit attachments to [util_commify_number $max_file_size] bytes.\n" } - if { $n_bytes == 0 } { + if { $tmp_size == 0 } { ad_complain "Your file is zero-length. Either you attempted to upload a zero length file, a file which does not exists, or something went wrong during the transfer.\n" } } } + # authenticate the user set user_id [ad_verify_and_get_user_id] @@ -126,17 +126,27 @@ } } - db_1row get_revisoin { + db_1row get_revision { select content_item.get_latest_revision(:attach_id) as revision_id from dual } - db_dml set_content { - update cr_revisions - set content = empty_blob() - where revision_id = :revision_id - returning content into :1 - } -blob_files [list $tmp_filename] +# db_dml set_content { +# update cr_revisions +# set content = empty_blob() +# where revision_id = :revision_id +# returning content into :1 +# } -blob_files [list $tmp_filename] + +# DRB: Since we're using acs_message to store the file, it is automatically +# stuffed into the file system rather than database whether we need it or +# not. This needs to be *changed* ... the whole way we read and write CR content +# based on storage type needs cleaning up. + + set tmp_filename [cr_create_content_file $attach_id $revision_id ${upload_file.tmpfile}] + + db_dml set_content_size "" + } ad_returnredirect "view-comment?comment_id=$parent_id&[export_url_vars return_url]" Index: openacs-4/packages/general-comments/www/file-download.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/general-comments/www/file-download.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/general-comments/www/file-download.tcl 14 Jun 2001 19:52:22 -0000 1.2 +++ openacs-4/packages/general-comments/www/file-download.tcl 31 Oct 2001 20:42:07 -0000 1.3 @@ -16,18 +16,4 @@ # check for permissions ad_require_permission $item_id read -# get the mime_type for the item -if { ![db_0or1row get_mime_type { - select mime_type - from cr_revisions - where revision_id = content_item.get_live_revision(:item_id) -}] } { - ad_return_complaint 1 "The item_id does not refer to a valid file attachment." -} - -ReturnHeaders $mime_type - -db_write_blob get_file " - select content - from cr_revisions - where revision_id = content_item.get_live_revision($item_id)" +cr_write_content -item_id $item_id Index: openacs-4/packages/general-comments/www/view-comment.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/general-comments/www/view-comment.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/general-comments/www/view-comment.adp 20 Apr 2001 20:51:11 -0000 1.1 +++ openacs-4/packages/general-comments/www/view-comment.adp 31 Oct 2001 20:42:07 -0000 1.2 @@ -11,12 +11,7 @@

@title@

- - <%= [util_convert_plaintext_to_html $content] %> - - - @content@ - +@html_content@

Index: openacs-4/packages/general-comments/www/view-comment.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/general-comments/www/view-comment.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/general-comments/www/view-comment.tcl 14 Jun 2001 19:52:22 -0000 1.2 +++ openacs-4/packages/general-comments/www/view-comment.tcl 31 Oct 2001 20:42:07 -0000 1.3 @@ -133,12 +133,14 @@ set allow_attach_p "f" } set comment_on_id [db_string get_object_id "select object_id from general_comments where comment_id = :comment_id"] -set page_title "View comment on: [acs_object_name $comment_on_id] (#$comment_id)" +set page_title "View comment on: [acs_object_name $comment_on_id]" set context_bar {"View comment"} set return_url_view "[ad_urlencode view-comment?[export_ns_set_vars url]]" set is_creator_p "f" if { $user_id == $creation_user } { set is_creator_p "t" } +set html_content [ad_html_text_convert -from $mime_type $content] + ad_return_template Index: openacs-4/packages/glossary/glossary.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/glossary.info,v diff -u -r1.2 -r1.3 --- openacs-4/packages/glossary/glossary.info 25 Oct 2001 01:52:19 -0000 1.2 +++ openacs-4/packages/glossary/glossary.info 31 Oct 2001 20:42:07 -0000 1.3 @@ -64,10 +64,7 @@ - - - Index: openacs-4/packages/glossary/www/illustration-add-edit-2-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/www/illustration-add-edit-2-postgresql.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/glossary/www/illustration-add-edit-2-postgresql.xql 27 Oct 2001 00:11:04 -0000 1.2 +++ openacs-4/packages/glossary/www/illustration-add-edit-2-postgresql.xql 31 Oct 2001 20:42:07 -0000 1.3 @@ -37,7 +37,7 @@ select content_item__new ( - :name, + varchar :name, NULL, NULL, NULL, Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/packages/glossary/www/illustration-bits-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/packages/glossary/www/illustration-bits-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/glossary/www/illustration-bits.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/www/illustration-bits.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/glossary/www/illustration-bits.tcl 20 Apr 2001 20:51:12 -0000 1.1 +++ openacs-4/packages/glossary/www/illustration-bits.tcl 31 Oct 2001 20:42:07 -0000 1.2 @@ -1,7 +1,7 @@ # glossary/www/illustration-bits.tcl ad_page_contract { - spits out correctly MIME-typed bits for a term's illustration, based on portrait-bits.tcl by philg@mit.edu + spits out correctly MIME-typed bits for a term's illustration @author walter@arsdigita.com @creation-date 11-21-2000 @@ -10,17 +10,4 @@ revision_id:integer } -if ![db_0or1row get_item_id "select mime_type -from cr_revisions -where revision_id = :revision_id"] { - ad_return_error "Couldn't find illustration" - return -} - -ReturnHeaders $mime_type - -db_write_blob output_illustration "select content -from cr_revisions -where revision_id = $revision_id" - - +cr_write_content -revision_id $revision_id Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/packages/glossary/www/illustration-bits.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/glossary/www/term-add-edit-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/www/term-add-edit-postgresql.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/glossary/www/term-add-edit-postgresql.xql 27 Oct 2001 00:11:04 -0000 1.2 +++ openacs-4/packages/glossary/www/term-add-edit-postgresql.xql 31 Oct 2001 20:42:07 -0000 1.3 @@ -67,7 +67,7 @@ select content_item__new ( - :name, + varchar :name, NULL, NULL, NULL, Index: openacs-4/packages/glossary/www/term-add-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/www/term-add-edit.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/glossary/www/term-add-edit.tcl 27 Oct 2001 00:11:04 -0000 1.3 +++ openacs-4/packages/glossary/www/term-add-edit.tcl 31 Oct 2001 20:42:07 -0000 1.4 @@ -19,7 +19,7 @@ glossary_item_id:optional,integer term:optional,trim name:optional,trim - definition:optional,trim + definition:html,optional,trim mime_type:optional publish_status:optional } -properties { @@ -136,18 +136,10 @@ -datatype text \ -value $definition - db_with_handle db { - template::query get_mime_types mime_types multilist { - select label, mime_type - from cr_text_mime_types - order by label - } -db $db - } - template::element create new_term mime_type \ -datatype text \ -widget select \ - -options $mime_types \ + -options [list [list "Plain text" "text/plain"] [list "HTML" "text/html"]] \ -values $mime_type set publish_states [glossary_publish_states] @@ -187,19 +179,10 @@ -widget textarea \ -datatype text - db_with_handle db { - template::query get_mime_types mime_types multilist { - select label, mime_type - from cr_text_mime_types - order by label - } -db $db - } - - template::element create new_term mime_type \ -datatype text \ -widget select \ - -options $mime_types \ + -options [list [list "Plain text" "text/plain"] [list "HTML" "text/html"]] \ -values "text/plain" switch $glossary_workflow { @@ -225,6 +208,7 @@ } if [template::form is_valid new_term] { + set peeraddr [ad_conn peeraddr] # context_id is the parent glossary_item_id @@ -238,10 +222,10 @@ db_dml term_update { insert into glossary_termsi ( item_id, revision_id, title, context_id, - creation_user, creation_ip + creation_user, creation_ip, mime_type ) values ( :item_id, :revision_id, - :term, :glossary_item_id, :user_id, :peeraddr + :term, :glossary_item_id, :user_id, :peeraddr, :mime_type ) } Index: openacs-4/packages/glossary/www/term-add-edit.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/www/term-add-edit.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/glossary/www/term-add-edit.xql 27 Oct 2001 00:11:04 -0000 1.2 +++ openacs-4/packages/glossary/www/term-add-edit.xql 31 Oct 2001 20:42:07 -0000 1.3 @@ -1,14 +1,6 @@ - - - select label, mime_type - from cr_text_mime_types - order by label - - - Index: openacs-4/packages/glossary/www/term.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/www/term.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/glossary/www/term.adp 20 Apr 2001 20:51:12 -0000 1.1 +++ openacs-4/packages/glossary/www/term.adp 31 Oct 2001 20:42:07 -0000 1.2 @@ -45,7 +45,7 @@ Definition:

-@definition@ +@html_definition@

Index: openacs-4/packages/glossary/www/term.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/www/term.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/glossary/www/term.tcl 27 Oct 2001 00:11:04 -0000 1.2 +++ openacs-4/packages/glossary/www/term.tcl 31 Oct 2001 20:42:07 -0000 1.3 @@ -84,6 +84,8 @@ where item_id = :item_id } +set html_definition [ad_html_text_convert -from $mime_type $definition] + set glossary_title [db_string get_glossary_title " select title from glossariesx where revision_id = content_item.get_live_revision(:glossary_item_id) Index: openacs-4/packages/postcard/www/postcard-picture.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/postcard/www/postcard-picture.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/postcard/www/postcard-picture.tcl 21 Aug 2001 22:22:29 -0000 1.2 +++ openacs-4/packages/postcard/www/postcard-picture.tcl 31 Oct 2001 20:42:07 -0000 1.3 @@ -10,6 +10,8 @@ {image_id:integer,notnull} } +# DRB: Someday this should be rewritten to use the content repository +# and its cr_write_content proc. ReturnHeaders [db_string mime_type { select mime_type Index: openacs-4/packages/simple-survey/www/process-response-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simple-survey/www/process-response-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/simple-survey/www/process-response-postgresql.xql 15 Jun 2001 01:06:39 -0000 1.1 +++ openacs-4/packages/simple-survey/www/process-response-postgresql.xql 31 Oct 2001 20:42:07 -0000 1.2 @@ -32,7 +32,7 @@ select content_item__new ( - :name, + varchar :name, null, null, null, Index: openacs-4/packages/simple-survey/www/view-attachment.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simple-survey/www/view-attachment.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/simple-survey/www/view-attachment.tcl 20 Apr 2001 20:51:22 -0000 1.1 +++ openacs-4/packages/simple-survey/www/view-attachment.tcl 31 Oct 2001 20:42:07 -0000 1.2 @@ -32,6 +32,8 @@ # moment we're still using tcl variable substitution because we # are certain that these are integers +# DRB: should be rewritten to use the content repository ... + db_write_blob return_attachment {select attachment_answer from survsimp_question_responses where response_id = $response_id and question_id = $question_id Index: openacs-4/packages/wp-slim/wp-slim.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/wp-slim.info,v diff -u -r1.6 -r1.7 --- openacs-4/packages/wp-slim/wp-slim.info 31 Oct 2001 05:30:46 -0000 1.6 +++ openacs-4/packages/wp-slim/wp-slim.info 31 Oct 2001 20:42:07 -0000 1.7 @@ -1,30 +1,29 @@ - + - + Wimpy Point Wimpy Points + f f - + oracle postgresql - Supervisor Rafael Calvo. Jack -Purswani and Sidharth Widge(Porter) + Jack Purswani +and Sidharth Widge(Porter) + Paul Konigsberg + Haolan Qin

Wimpy Point allows users to collaborate and share online presentations. - 2001-31-10 - University of -Sydney - Ported (Jack and Sid). Fixed -several -bugs. + 2001-01-26 + ArsDigita Corporation + Ported (Jack). Fixed several bugs. Added new features (e.g. versioning and authorization). + + @@ -33,218 +32,146 @@ + + - - + + - - - + + + - - + + - - + + - - + + - - + + - - - + + + - - + + - - + + - - - + + + - - - - - + + - - - + + + - - - + + + - - - + -<<<<<<< wp-slim.info - ->>>>>>> 1.5 + + + - - - + + + - - + + - - - + + + - - + + - - + + - - - + + + - - - - + + + + + - - - + - - + + + - - + + - - -<<<<<<< wp-slim.info - ->>>>>>> 1.5 -<<<<<<< wp-slim.info - ->>>>>>> 1.5 Index: openacs-4/packages/wp-slim/www/attach.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/attach.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/wp-slim/www/attach.tcl 4 Oct 2001 04:29:01 -0000 1.2 +++ openacs-4/packages/wp-slim/www/attach.tcl 31 Oct 2001 20:42:07 -0000 1.3 @@ -87,8 +87,6 @@ end; }] -set db [ns_db gethandle] - set path $tmp_filename if {[string equal $guessed_file_type "*/*"]} { @@ -105,6 +103,4 @@ } } -ns_db releasehandle $db - ad_returnredirect edit-slide?[export_url_vars slide_item_id pres_item_id] Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/packages/wp-slim/www/get-binary-data-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/packages/wp-slim/www/get-binary-data-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/wp-slim/www/get-binary-data.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/get-binary-data.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/wp-slim/www/get-binary-data.tcl 4 Oct 2001 04:29:01 -0000 1.2 +++ openacs-4/packages/wp-slim/www/get-binary-data.tcl 31 Oct 2001 20:42:07 -0000 1.3 @@ -16,23 +16,13 @@ # serve content. I wonder what is "the content repository's methods of spitting back blobs". # Does it exist at all? +# DRB: it didn't exist when you asked the question but it does now! + set url [ad_conn url] if {![regexp {attach/([0-9]+)/(.*)} $url match attach_id file_name]} { ns_log notice "Could not get a pres_item_id and slide_item_id out of url=$url" ad_return_error "Wimpy Point" "Could not get a pres_item_id and slide_item_id out of url=$url" } - -set mime_type [db_string get_mime_type { -select mime_type -from cr_revisions -where revision_id = :attach_id -}] - -ReturnHeaders $mime_type -db_write_blob get_image " -select content -from cr_revisions -where revision_id = $attach_id -" +cr_write_content -item_id $attach_id Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/packages/wp-slim/www/get-binary-data.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/wp-slim/www/index.vuh =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/index.vuh,v diff -u -r1.1 -r1.2 --- openacs-4/packages/wp-slim/www/index.vuh 20 Apr 2001 20:51:24 -0000 1.1 +++ openacs-4/packages/wp-slim/www/index.vuh 31 Oct 2001 20:42:07 -0000 1.2 @@ -15,6 +15,9 @@ # which makes some db querries, then that .tcl file calls ad_return_template to return its # template. +# DRB: This is mildly insane. Either we should implement templated virtual URLs or +# package authors should live with ugly URLs. + set url [ad_conn extra_url] set subsite_name [ad_conn package_url] @@ -50,7 +53,7 @@ adp_parse_ad_conn_file } else { # Didn't understand the URL. - ns_log notice "## Wimpy Point: Sorry I could not resolve the URL you requested." + ns_log notice "## Wimpy Point: Sorry I could not resolve the URL you requested: $url" ad_return_error "Wimpy Point Error" "Sorry I could not resolve the URL you requested." return } Index: openacs-4/packages/wp-slim/www/serve-slide.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/serve-slide.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/wp-slim/www/serve-slide.adp 4 Oct 2001 04:29:01 -0000 1.2 +++ openacs-4/packages/wp-slim/www/serve-slide.adp 31 Oct 2001 20:42:07 -0000 1.3 @@ -19,7 +19,7 @@
- +

@preamble@ @@ -43,7 +43,7 @@ - +
    @@ -69,7 +69,7 @@ - +

    @postamble@