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.33.2.30 -r1.33.2.31 --- openacs-4/packages/acs-content-repository/acs-content-repository.info 1 Mar 2005 00:18:42 -0000 1.33.2.30 +++ openacs-4/packages/acs-content-repository/acs-content-repository.info 29 Mar 2005 13:50:32 -0000 1.33.2.31 @@ -7,7 +7,7 @@ t t - + Dan Wickstrom The canonical repository for OpenACS content. 2005-02-28 @@ -17,13 +17,16 @@ other CMS backing functionality. Utilized by Bug Tracker, File Storage, and other packages. - + + + + Index: openacs-4/packages/acs-content-repository/sql/oracle/content-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/sql/oracle/content-create.sql,v diff -u -r1.21.4.1 -r1.21.4.2 --- openacs-4/packages/acs-content-repository/sql/oracle/content-create.sql 6 Sep 2004 16:43:47 -0000 1.21.4.1 +++ openacs-4/packages/acs-content-repository/sql/oracle/content-create.sql 29 Mar 2005 13:51:38 -0000 1.21.4.2 @@ -883,3 +883,55 @@ end; / show errors + + +-- Create the default templates +declare + v_item_id integer; + v_revision_id integer; +begin + + select acs_object_id_seq.nextval into v_item_id from dual; + + v_item_id := content_template.new ( + name => 'default_template', + parent_id => -200, + template_id => v_item_id + ); + + v_revision_id := content_revision.new ( + title => 'template', + mime_type => 'text/html', + item_id => v_item_id + ); + + update + cr_items + set + live_revision = v_revision_id + where + item_id = v_item_id; + + content_type.register_template ( + content_type => 'content_revision', + template_id => v_item_id, + use_context => 'public', + is_default => 't' + ); + + content_type.register_template ( + content_type => 'image', + template_id => v_item_id, + use_context => 'public', + is_default => 't' + ); + + content_type.register_template ( + content_type => 'content_template', + template_id => v_item_id, + use_context => 'public', + is_default => 't' + ); +end; +/ +show errors Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-content-repository/sql/oracle/upgrade/upgrade-5.1.5-5.1.6d1.sql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/acs-content-repository/tcl/acs-content-repository-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/acs-content-repository-procs-oracle.xql,v diff -u -r1.4 -r1.4.2.1 --- openacs-4/packages/acs-content-repository/tcl/acs-content-repository-procs-oracle.xql 13 Feb 2003 14:42:53 -0000 1.4 +++ openacs-4/packages/acs-content-repository/tcl/acs-content-repository-procs-oracle.xql 29 Mar 2005 13:50:33 -0000 1.4.2.1 @@ -13,4 +13,48 @@ + + + + select live_revision as revision_id + from cr_items + where name = 'default_template' + and parent_id = -200 + + + + + + + + update cr_revisions + set content = empty_blob() + where revision_id = :revision_id + returning content into :1 + + + + + + + + select live_revision as revision_id + from cr_items + where name = 'default_template' + and parent_id = -200 + + + + + + + + update cr_revisions + set content = empty_blob() + where revision_id = :revision_id + returning content into :1 + + + + Index: openacs-4/packages/acs-content-repository/tcl/acs-content-repository-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/acs-content-repository-procs.tcl,v diff -u -r1.5 -r1.5.4.1 --- openacs-4/packages/acs-content-repository/tcl/acs-content-repository-procs.tcl 28 Oct 2003 22:30:23 -0000 1.5 +++ openacs-4/packages/acs-content-repository/tcl/acs-content-repository-procs.tcl 29 Mar 2005 13:50:33 -0000 1.5.4.1 @@ -67,3 +67,35 @@ } } } + +ad_proc -private cr_after_install {} { + if {[db_type] == "oracle"} { + set default_template "" + + db_transaction { + db_1row get_template_id {} + db_dml update_default_template {} -blobs [list $default_template] + } + } +} + +ad_proc -public cr_after_upgrade { + {-from_version_name:required} + {-to_version_name:required} +} { + apm_upgrade_logic \ + -from_version_name $from_version_name \ + -to_version_name $to_version_name \ + -spec { + 5.1.5 5.1.6d1 { + if {[db_type] == "oracle"} { + set default_template "" + + db_transaction { + db_1row get_template_id {} + db_dml update_default_template {} -blobs [list $default_template] + } + } + } + } +} Index: openacs-4/packages/acs-content-repository/tcl/filter-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/filter-procs.tcl,v diff -u -r1.16.2.8 -r1.16.2.9 --- openacs-4/packages/acs-content-repository/tcl/filter-procs.tcl 12 Feb 2005 15:35:34 -0000 1.16.2.8 +++ openacs-4/packages/acs-content-repository/tcl/filter-procs.tcl 29 Mar 2005 13:50:33 -0000 1.16.2.9 @@ -212,7 +212,11 @@ variable template_path # Get the template - set template_found_p [db_0or1row get_template_url "" -column_array info] + if {[catch { + set template_found_p [db_0or1row get_template_url "" -column_array info] + }]} { + set template_found_p 0 + } if { !$template_found_p || [string equal $info(template_url) {}] } { ns_log notice "content::init: No template found to render content item $item_id in context '$context'"