Index: openacs-4/packages/acs-content-repository/tcl/filter-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/filter-procs-oracle.xql,v diff -u -r1.5 -r1.5.2.1 --- openacs-4/packages/acs-content-repository/tcl/filter-procs-oracle.xql 11 Jul 2002 12:56:28 -0000 1.5 +++ openacs-4/packages/acs-content-repository/tcl/filter-procs-oracle.xql 1 Mar 2003 21:54:15 -0000 1.5.2.1 @@ -3,7 +3,7 @@ oracle8.1.6 - + , content.blob_to_string(content) as text Index: openacs-4/packages/acs-content-repository/tcl/filter-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/filter-procs-postgresql.xql,v diff -u -r1.7 -r1.7.2.1 --- openacs-4/packages/acs-content-repository/tcl/filter-procs-postgresql.xql 11 Jul 2002 12:56:28 -0000 1.7 +++ openacs-4/packages/acs-content-repository/tcl/filter-procs-postgresql.xql 1 Mar 2003 21:54:16 -0000 1.7.2.1 @@ -2,7 +2,7 @@ postgresql7.1 - + , content as text 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.11 -r1.11.2.1 --- openacs-4/packages/acs-content-repository/tcl/filter-procs.tcl 17 Sep 2002 19:06:45 -0000 1.11 +++ openacs-4/packages/acs-content-repository/tcl/filter-procs.tcl 1 Mar 2003 21:54:16 -0000 1.11.2.1 @@ -123,17 +123,15 @@ ad_proc -public get_folder_labels { { varname "folders" } } { variable item_id - set url "" # this repeats the query used to look up the item in the first place # but there does not seem to be a clear way around this # build the folder URL out as we iterate over the query set query [db_map get_url] - uplevel 1 "db_multirow $varname ignore_get_url $query { - append url $name/ - set url ${url}index.acs - }" + db_multirow -extend {url} $varname ignore_get_url $query { + append url "$name/" + } } ad_proc -public get_content_value { revision_id } { Index: openacs-4/packages/acs-content-repository/tcl/filter-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/filter-procs.xql,v diff -u -r1.2 -r1.2.4.1 --- openacs-4/packages/acs-content-repository/tcl/filter-procs.xql 13 Sep 2001 04:59:26 -0000 1.2 +++ openacs-4/packages/acs-content-repository/tcl/filter-procs.xql 1 Mar 2003 21:54:16 -0000 1.2.4.1 @@ -43,6 +43,7 @@ x.*, :item_id as item_id $text_sql, :content_type as content_type + $text_sql from cr_revisions r, ${table_name}x x where Index: openacs-4/packages/cms-news-demo/templates/demo_articles/article-list.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms-news-demo/templates/demo_articles/article-list.tcl,v diff -u -r1.1.1.1 -r1.1.1.1.4.1 --- openacs-4/packages/cms-news-demo/templates/demo_articles/article-list.tcl 20 Apr 2001 20:51:11 -0000 1.1.1.1 +++ openacs-4/packages/cms-news-demo/templates/demo_articles/article-list.tcl 1 Mar 2003 21:54:46 -0000 1.1.1.1.4.1 @@ -16,7 +16,7 @@ request set_param article_link_color -datatype text -template::query articles multirow " +template::query articles articles multirow " select live_revision, location, title, name, content_item.get_path( i.item_id ) as url Index: openacs-4/packages/cms-news-demo/templates/demo_articles/article-template-1.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms-news-demo/templates/demo_articles/article-template-1.tcl,v diff -u -r1.1.1.1 -r1.1.1.1.4.1 --- openacs-4/packages/cms-news-demo/templates/demo_articles/article-template-1.tcl 20 Apr 2001 20:51:11 -0000 1.1.1.1 +++ openacs-4/packages/cms-news-demo/templates/demo_articles/article-template-1.tcl 1 Mar 2003 21:54:46 -0000 1.1.1.1.4.1 @@ -2,7 +2,7 @@ template::util::array_to_vars content -template::query links multirow " +template::query links links multirow " select relation_tag from @@ -13,4 +13,4 @@ parent_id = :item_id order by order_n -" \ No newline at end of file +" Index: openacs-4/packages/cms-news-demo/templates/demo_articles/article-template-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms-news-demo/templates/demo_articles/article-template-2.tcl,v diff -u -r1.1.1.1 -r1.1.1.1.4.1 --- openacs-4/packages/cms-news-demo/templates/demo_articles/article-template-2.tcl 20 Apr 2001 20:51:11 -0000 1.1.1.1 +++ openacs-4/packages/cms-news-demo/templates/demo_articles/article-template-2.tcl 1 Mar 2003 21:54:46 -0000 1.1.1.1.4.1 @@ -1,7 +1,7 @@ content::get_content template::util::array_to_vars content -template::query links multirow " +template::query links links multirow " select relation_tag from Index: openacs-4/packages/cms-news-demo/templates/demo_articles/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms-news-demo/templates/demo_articles/index.tcl,v diff -u -r1.1.1.1 -r1.1.1.1.4.1 --- openacs-4/packages/cms-news-demo/templates/demo_articles/index.tcl 20 Apr 2001 20:51:11 -0000 1.1.1.1 +++ openacs-4/packages/cms-news-demo/templates/demo_articles/index.tcl 1 Mar 2003 21:54:46 -0000 1.1.1.1.4.1 @@ -21,4 +21,4 @@ order by publish_date" -query items multirow $query +query items items multirow $query Index: openacs-4/packages/cms-news-demo/templates/demo_articles/master-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms-news-demo/templates/demo_articles/master-2.tcl,v diff -u -r1.1.1.1 -r1.1.1.1.4.1 --- openacs-4/packages/cms-news-demo/templates/demo_articles/master-2.tcl 20 Apr 2001 20:51:11 -0000 1.1.1.1 +++ openacs-4/packages/cms-news-demo/templates/demo_articles/master-2.tcl 1 Mar 2003 21:54:46 -0000 1.1.1.1.4.1 @@ -16,7 +16,7 @@ } -template::query articles multirow " +template::query articles articles multirow " select live_revision, location, title, name from @@ -42,4 +42,4 @@ } -set static_root [cms_news::get_static_content_root] \ No newline at end of file +set static_root [cms_news::get_static_content_root] Index: openacs-4/packages/cms-news-demo/www/install-wizard-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms-news-demo/www/install-wizard-2.tcl,v diff -u -r1.1.1.1 -r1.1.1.1.4.1 --- openacs-4/packages/cms-news-demo/www/install-wizard-2.tcl 20 Apr 2001 20:51:11 -0000 1.1.1.1 +++ openacs-4/packages/cms-news-demo/www/install-wizard-2.tcl 1 Mar 2003 21:55:16 -0000 1.1.1.1.4.1 @@ -11,11 +11,9 @@ # by checking if the demo_articles folder exists under the # templates root and the sitemap root -set db [template::get_db_handle] - -template::query demo_folders onevalue " +db_1row demo_folders { select - count(1) + count(1) as demo_folders from cr_items where @@ -26,7 +24,7 @@ name = 'demo_articles' and content_type = 'content_folder' -" -db $db +} if { $demo_folders != 2 } { set demo_folders_p f @@ -40,9 +38,9 @@ # of live templates in the /demo_articles folder under the # templates mount point -template::query published_templates onevalue " +db_1row published_templates { select - count(1) + count(1) as published_templates from cr_items where @@ -62,7 +60,7 @@ name = 'demo_articles' and content_type = 'content_folder' ) -" -db $db +} if { $published_templates < 8 } { set published_templates_p f @@ -71,10 +69,9 @@ } - # get the user id of a cm_admin -template::query cm_admin onevalue " +set cm_admin [db_string cm_admin " select distinct user_id from @@ -90,10 +87,8 @@ module_id, user_id, 'cm_admin') = 't' and user_id = [User::getID] -" -db $db +" -default ""] -template::release_db_handle - if { [template::util::is_nil cm_admin] } { template::forward install-wizard return @@ -115,22 +110,21 @@ set html "" - set db [template::begin_db_transaction] + db_transaction { # some root folders - template::query sitemap onevalue " - select content_item.get_root_folder from dual - " -db $db + db_1row sitemap " + select content_item.get_root_folder as sitemap from dual + " - template::query templates onevalue " - select content_template.get_root_folder from dual - " -db $db + db_1row templates " + select content_template.get_root_folder as templates from dual + " - # create demo_articles folder - ns_ora exec_plsql_bind $db " + set folder_id [db_exec_plsql demo_articles_folder_new " begin - :folder_id := content_folder.new ( + :1 := content_folder.new ( name => 'demo_articles', label => 'Demo Articles', description => 'Articles for publication', @@ -139,12 +133,12 @@ parent_id => :sitemap ); end; - " folder_id + "] append html "
  • Created /demo_articles folder under the sitemap." # register content types to demo_articles folder - ns_ora dml $db " + db_dml register_content_types " begin delete from cr_folder_type_map where folder_id = :folder_id; @@ -163,9 +157,9 @@ append html "
  • Registered content types to /demo_articles." # create article index - ns_ora exec_plsql_bind $db " + set item_id [db_exec_plsql article_index_new " begin - :item_id := content_item.new ( + :1 := content_item.new ( name => 'index', parent_id => :folder_id, content_type => 'content_revision', @@ -176,14 +170,14 @@ creation_ip => :creation_ip ); end; - " item_id + "] append html "
  • Created /demo_articles/index content item." # create demo templates folder and templates - ns_ora exec_plsql_bind $db " + set folder_id [db_exec_plsql folder_new " begin - :folder_id := content_folder.new ( + :1 := content_folder.new ( name => 'demo_articles', label => 'Demo Article Templates', description => 'Templates for demo articles and links', @@ -192,12 +186,12 @@ parent_id => :templates ); end; - " folder_id + "] append html "
  • Created /demo_articles folder under the templates mount point." # register content type to the folder - ns_ora dml $db " + db_dml register_content_type " begin content_folder.register_content_type ( folder_id => :folder_id, @@ -208,27 +202,27 @@ append html "
  • Registered templates to the /demo_articles folder." # create index template - ns_ora exec_plsql_bind $db " + set template_id [db_exec_plsql template_new " begin - :template_id := content_template.new ( + :1 := content_template.new ( name => 'index', parent_id => :folder_id, creation_user => :user_id, creation_ip => :creation_ip ); end; - " template_id + "] # make the index template an adp file - ns_ora dml $db " + db_dml index_template_new " update cr_revisions set mime_type = 'text/adp' where item_id = :template_id" append html "
  • Created /demo_articles/index template for articles index page." # register template index template to content_revision and index page - ns_ora dml $db " + db_dml register_template_index " begin content_type.register_template ( content_type => 'content_revision', @@ -248,34 +242,34 @@ # create more templates - ns_ora exec_plsql_bind $db " + set template_id [db_exec_plsql more_templates " begin - :template_id := content_template.new ( + :1 := content_template.new ( name => 'master-1', parent_id => :folder_id, creation_user => :user_id, creation_ip => :creation_ip ); end; - " template_id + "] append html "
  • Created /demo_articles/master-1 master template." - ns_ora exec_plsql_bind $db " + set template_id [db_exec_plsql article_template_1 " begin - :template_id := content_template.new ( + :1 := content_template.new ( name => 'article-template-1', parent_id => :folder_id, creation_user => :user_id, creation_ip => :creation_ip ); end; - " template_id + "] append html "
  • Created /demo_articles/article-template-1 article template." # register template to articles - ns_ora dml $db " + db_dml register_article_template_1 " begin content_type.register_template ( content_type => 'cr_demo_article', @@ -288,33 +282,33 @@ append html "
  • Registered the article template as the default for articles." # more article templates - ns_ora exec_plsql_bind $db " + set template_id [db_exec_plsql master_2 " begin - :template_id := content_template.new ( + :1 := content_template.new ( name => 'master-2', parent_id => :folder_id, creation_user => :user_id, creation_ip => :creation_ip ); end; - " template_id + "] append html "
  • Createed /demo_articles/master-2 master template." - ns_ora exec_plsql_bind $db " + set template_id [db_exec_plsql article_template_2 " begin - :template_id := content_template.new ( + :1 := content_template.new ( name => 'article-template-2', parent_id => :folder_id, creation_user => :user_id, creation_ip => :creation_ip ); end; - " template_id + "] append html "
  • Created /demo_articles/article-template-2 article template." - ns_ora dml $db " + db_dml register_article_template_2 " begin content_type.register_template ( content_type => 'cr_demo_article', @@ -327,35 +321,35 @@ append html "
  • Registered the 2nd article template to articles." # article list template - ns_ora exec_plsql_bind $db " + set template_id [db_exec_plsql article_list " begin - :template_id := content_template.new ( + :1 := content_template.new ( name => 'article-list', parent_id => :folder_id, creation_user => :user_id, creation_ip => :creation_ip ); end; - " template_id + "] append html "
  • Created /demo_articles/article-list template for listing articles." # multimedia link template - ns_ora exec_plsql_bind $db " + set template_id [db_exec_plsql article_link_template " begin - :template_id := content_template.new ( + :1 := content_template.new ( name => 'article-link-template', parent_id => :folder_id, creation_user => :user_id, creation_ip => :creation_ip ); end; - " template_id + "] append html "
  • Created /demo_articles/article-link-template." - ns_ora dml $db " + db_dml register_article_link_template " begin content_type.register_template ( content_type => 'cr_demo_link', @@ -369,20 +363,20 @@ to the cr_demo_link content type." # captioned image template - ns_ora exec_plsql_bind $db " + set template_id [db_exec_plsql cap_image_template " begin - :template_id := content_template.new ( + :1 := content_template.new ( name => 'captioned-image-template', parent_id => :folder_id, creation_user => :user_id, creation_ip => :creation_ip ); end; - " template_id + "] append html "
  • Created /demo_articles/captioned-image-template." - ns_ora dml $db " + db_dml register_cap_image_template " begin content_type.register_template ( content_type => 'cr_demo_article_image', @@ -396,20 +390,20 @@ to the cr_demo_article_image content type." # master template - ns_ora exec_plsql_bind $db " + set template_id [db_exec_plsql master " begin - :template_id := content_template.new ( + :1 := content_template.new ( name => 'master', parent_id => :templates, creation_user => :user_id, creation_ip => :creation_ip ); end; - " template_id + "] append html "
  • Created /master, the demo master template." - template::end_db_transaction + } } @@ -449,39 +443,39 @@ set revision_id [content::get_object_id] set tmpfile "$package_root/templates$template.adp" - set db [template::begin_db_transaction] + db_transaction { - template::query template_id onevalue " + db_1row template_id " select - content_item.get_id( :template, content_template.get_root_folder ) + content_item.get_id( :template, content_template.get_root_folder ) as template_id from dual - " -db $db - + " + # upload the template # this is safe because none of the templates exceeds the max size set adp_text [template::util::read_file $tmpfile] - template::query index_template onevalue " + db_1row index_template " select - item_id + item_id as index_template from cr_items where item_id = content_item.get_id( '/demo_articles/index', content_template.get_root_folder ) - " -db $db + " if { $template_id == $index_template } { set mime_type "text/adp" } else { set mime_type "text/html" } - ns_ora exec_plsql_bind $db " + set revision_id [db_exec_plsql get_revision_id " begin - :revision_id := content_revision.new ( + :1 := content_revision.new ( revision_id => :revision_id, item_id => :template_id, title => 'News Demo Template', @@ -491,15 +485,15 @@ creation_ip => :creation_ip ); end; - " revision_id + "] - ns_ora dml $db " + db_dml update_revision " update cr_items set live_revision = :revision_id, publish_status = 'live' where item_id = :template_id" - template::end_db_transaction + } # publish the template to the file system and set the live revision set text [content::get_content_value $revision_id] @@ -538,13 +532,13 @@ set tmpfile "$package_root/templates/demo_articles/index.tcl" set tcl_text [template::util::read_file $tmpfile] - publish::write_multiple_files "/demo_articles/index.tcl" $tcl_text + publish::write_multiple_files "[acs_root_dir]/templates/templates/demo_articles/index.tcl" $tcl_text append html2 "
  • Copied $path.tcl.
    " # publish the index item - template::query revision_id onevalue " + db_1row get_live_revision " select - live_revision + live_revision as revision_id from cr_items where Index: openacs-4/packages/cms-news-demo/www/install-wizard-3.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms-news-demo/www/install-wizard-3.tcl,v diff -u -r1.1.1.1 -r1.1.1.1.4.1 --- openacs-4/packages/cms-news-demo/www/install-wizard-3.tcl 20 Apr 2001 20:51:11 -0000 1.1.1.1 +++ openacs-4/packages/cms-news-demo/www/install-wizard-3.tcl 1 Mar 2003 21:55:16 -0000 1.1.1.1.4.1 @@ -7,12 +7,10 @@ -set db [template::get_db_handle] - # get the user id of a cm_admin -template::query cm_admin onevalue " +db_1row cm_admin " select - distinct user_id + distinct user_id as cm_admin from users u, cm_modules m where @@ -26,28 +24,25 @@ module_id, user_id, 'cm_admin') = 't' and user_id = [User::getID] -" -db $db +" # check if author, editor, and publisher users have been created -template::query demo_users onevalue " +db_1row demo_users " select - count(1) + count(1) as demo_users from users where screen_name in ('author','editor','publisher') -" -db $db +" if { $demo_users < 3 } { set demo_users_p f } else { set demo_users_p t } - -template::release_db_handle - if { [template::util::is_nil cm_admin] } { template::forward install-wizard return @@ -60,20 +55,14 @@ set creation_ip [ns_conn peeraddr] set user_id $cm_admin - - - - - # register demo users if not already registered: # author, editor, publisher set html "" if { $demo_users < 3 } { - set db [template::begin_db_transaction] - + db_transaction { set demo_user_list \ { {Author author} {Editor editor} {Publisher publisher} } @@ -82,14 +71,14 @@ set screen_name [lindex $demo_user 1] # check if the user exists already - template::query user_exists_p onevalue " + db_1row user_exists_p " select - count(1) + count(1) as user_exists_p from users where screen_name = :screen_name - " -db $db + " # if the user doesn't exists, create the user if { $user_exists_p == 0 } { @@ -101,7 +90,7 @@ set user_id [ad_user_new $email $name $name $password "" ""] - ns_ora dml $db " + db_dml update_users " update users set screen_name = :screen_name where user_id = :user_id" @@ -113,7 +102,7 @@ } } - template::end_db_transaction + } } @@ -129,4 +118,4 @@ template::forward install-wizard-4 -} \ No newline at end of file +} Index: openacs-4/packages/cms-news-demo/www/install-wizard-4.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms-news-demo/www/install-wizard-4.tcl,v diff -u -r1.1.1.1 -r1.1.1.1.4.1 --- openacs-4/packages/cms-news-demo/www/install-wizard-4.tcl 20 Apr 2001 20:51:11 -0000 1.1.1.1 +++ openacs-4/packages/cms-news-demo/www/install-wizard-4.tcl 1 Mar 2003 21:55:16 -0000 1.1.1.1.4.1 @@ -7,10 +7,8 @@ set html "" -set db [template::get_db_handle] - # get the user id of a cm_admin -template::query cm_admin onevalue " +set cm_admin [db_string cm_admin " select distinct user_id from @@ -26,11 +24,8 @@ module_id, user_id, 'cm_admin') = 't' and user_id = [User::getID] -" -db $db +" -default ""] - -template::release_db_handle - if { [template::util::is_nil cm_admin] } { template::forward install-wizard return @@ -44,48 +39,43 @@ set user_id $cm_admin - - - # grant permissions to demo users -set db [template::begin_db_transaction] +db_transaction { # some root folders -template::query sitemap onevalue " - select content_item.get_root_folder from dual -" -db $db +db_1row sitemap " + select content_item.get_root_folder as sitemap from dual +" -template::query templates onevalue " - select content_template.get_root_folder from dual -" -db $db +db_1row templates " + select content_template.get_root_folder as templates from dual +" # some user ID's -template::query author onevalue " - select user_id from users where screen_name = 'author' -" -db $db +db_1row author " + select user_id as author from users where screen_name = 'author' +" -template::query editor onevalue " - select user_id from users where screen_name = 'editor' -" -db $db +db_1row editor " + select user_id as editor from users where screen_name = 'editor' +" -template::query publisher onevalue " - select user_id from users where screen_name = 'publisher' -" -db $db +db_1row publisher " + select user_id as publisher from users where screen_name = 'publisher' +" - # some folder/module ID's -template::query demo_articles onevalue " - select content_item.get_id( '/demo_articles' ) from dual -" -db $db +db_1row demo_articles " + select content_item.get_id( '/demo_articles' ) as demo_articles from dual +" -template::query other_modules onelist " +set other_modules [db_list other_modules " select module_id from cm_modules where key ^= 'sitemap' -" -db $db +"] - # grant permissions -ns_ora dml $db " +db_dml grant_perms " begin cms_permission.grant_permission ( item_id => :sitemap, @@ -145,7 +135,7 @@ foreach module_id $other_modules { - ns_ora dml $db " + db_dml grant1 " begin cms_permission.grant_permission ( item_id => :module_id, @@ -160,7 +150,7 @@ append html "
  • Granted cm_examine to author on all other modules." foreach module_id $other_modules { - ns_ora dml $db " + db_dml grant2 " begin cms_permission.grant_permission ( item_id => :module_id, @@ -175,7 +165,7 @@ append html "
  • Granted cm_examine to editor on all other modules." foreach module_id $other_modules { - ns_ora dml $db " + db_dml grant3 " begin cms_permission.grant_permission ( item_id => :module_id, @@ -189,6 +179,5 @@ append html "
  • Granted cm_write to publisher on all other modules." -template::end_db_transaction +} - Index: openacs-4/packages/cms-news-demo/www/install-wizard.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms-news-demo/www/install-wizard.tcl,v diff -u -r1.1.1.1 -r1.1.1.1.4.1 --- openacs-4/packages/cms-news-demo/www/install-wizard.tcl 20 Apr 2001 20:51:11 -0000 1.1.1.1 +++ openacs-4/packages/cms-news-demo/www/install-wizard.tcl 1 Mar 2003 21:55:16 -0000 1.1.1.1.4.1 @@ -9,16 +9,14 @@ # by checking if the cr_demo_article, cr_demo_article_image, and cr_demo_link # content types exist -set db [template::get_db_handle] - -template::query news_demo_content_types onevalue " +db_1row news_demo_content_types " select - count(1) + count(1) news_demo_content_types from acs_object_types where object_type in ('cr_demo_article','cr_demo_article_image', 'cr_demo_link') -" -db $db +" if { $news_demo_content_types != 3 } { @@ -35,9 +33,9 @@ # check if a cm_admin user exists -- a user who has the 'cm_admin' privilege # on the CMS root folders and CMS modules -template::query cm_admin onevalue " +db_1row cm_admin " select - distinct user_id + distinct user_id cm_admin from users u, cm_modules m where @@ -51,10 +49,8 @@ module_id, user_id, 'cm_admin') = 't' and user_id = [User::getID] -" -db $db +" -template::release_db_handle - if { [template::util::is_nil cm_admin] } { set cm_admin_p f return