Index: openacs-4/packages/cms/tcl/module-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/module-procs.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/cms/tcl/module-procs.tcl 20 Aug 2001 04:35:41 -0000 1.5 +++ openacs-4/packages/cms/tcl/module-procs.tcl 15 Aug 2002 03:39:34 -0000 1.6 @@ -38,10 +38,7 @@ Get the id of some module, return empty string on failure } { - template::query module_get_id id onevalue " - select module_id from cm_modules - where key = :module_name - " -cache "get_module_name $module_name" -persistent + set id [db_string module_get_id ""] return $id } @@ -51,13 +48,7 @@ Get a list of all the mount points } { - - template::query get_list mount_point_list multilist "select - key, name, '' as id, - '' as children, 't' as expandable, 'f' as symlink, - 0 as update_time - from cm_modules - order by sort_key" + set mount_point_list [db_list_of_lists get_list ""] # Append clipboard lappend mount_point_list [folderCreate "clipboard" "Clipboard" "" [list] t f 0] @@ -74,26 +65,7 @@ # query for child site nodes set module_name [namespace tail [namespace current]] - template::query module_get_result result multilist " - select - :mount_point as mount_point, - r.name, - r.item_id, - '' as children, - nvl((select 't' from dual where exists - (select 1 from cr_folders f_child, cr_resolved_items r_child - where r_child.parent_id = r.resolved_id - and f_child.folder_id = r_child.resolved_id)), 'f') expandable, - r.is_symlink symlink, - 0 update_time - from - cr_folders f, cr_resolved_items r - where - r.parent_id = :id - and - r.resolved_id = f.folder_id - order by - name" + set result [db_list_of_lists module_get_result ""] return $result } @@ -112,8 +84,7 @@ } { if { ![nsv_exists browser_state template_root] } { - template::query template_get_root_id root_id onevalue " - select content_template.get_root_folder() from dual" + set root_id [db_string template_get_root_id ""] nsv_set browser_state template_root $root_id return $root_id } else { @@ -158,8 +129,7 @@ } { if { ![nsv_exists browser_state sitemap_root] } { - template::query sitemap_get_root_id root_id onevalue " - select content_item.get_root_folder() from dual" + set root_id [db_string sitemap_get_root_id ""] nsv_set browser_state sitemap_root $root_id return $root_id } else { @@ -193,9 +163,7 @@ upvar sorted_paths_root_id _root_id set _root_id $root_id set sql [db_map sitemap_get_name] - uplevel " - template::query sitemap_get_name $name multirow \{$sql\} -eval \{$eval_code\} - " + uplevel "db_multirow $name sitemap_get_name \{$sql\} { $eval_code }" } @@ -208,17 +176,7 @@ } { - template::query types_get_result result multilist " - select - lpad(' ', level, '-') || pretty_name as label, - object_type as value - from - acs_object_types t - connect by - supertype = prior object_type - start with - object_type = 'content_revision' - " + set result [db_list_of_lists types_get_result ""] set result [concat [list [list "--" ""]] $result] @@ -241,25 +199,7 @@ # query for message categories set module_name [namespace tail [namespace current]] - template::query get_result result multilist "select - :module_name as mount_point, - t.pretty_name, - t.object_type, - '' as children, - NVL( - (select 't' from dual - where exists (select 1 from acs_object_types - where supertype = t.object_type)), - 'f' - ) as expandable, - 'f' as symlink, - 0 as update_time - from - acs_object_types t - where - supertype = :id - order by - t.pretty_name" + set result [db_list_of_lists get_result ""] return $result } @@ -292,27 +232,7 @@ # query for keyword categories - template::query category_get_children children multilist "select - :module_name as mount_point, - content_keyword.get_heading(keyword_id) as name, - keyword_id, - '' as children, - NVL( (select 't' from dual - where exists ( - select 1 from cr_keywords k2 - where k2.parent_id = k.keyword_id - and content_keyword.is_leaf(k2.keyword_id) = 'f')), - 'f') as expandable, - 'f' as symlink, - 0 as update_time - from - cr_keywords k - where - $where_clause - and - content_keyword.is_leaf(keyword_id) = 'f' - order by - name" + set children [db_list_of_lists category_get_children ""] return $children } @@ -327,7 +247,7 @@ append sql_id_list "'" set sql [db_map get_paths] - uplevel "template::query get_paths $name multirow \{$sql\} -eval \{$eval_code\}" + uplevel "db_multirow $name get_paths \{$sql\} \{$eval_code\}" } @@ -352,25 +272,8 @@ set module_name [namespace tail [namespace current]] - template::query users_get_result result multilist "select - :module_name as mount_point, - g.group_name as name, - g.group_id, '' as children, - NVL( - (select 't' from dual - where exists ( - select 1 from group_component_map m2 - where m2.group_id = g.group_id)), - 'f' - ) as expandable, - 'f' as symlink, - 0 as update_time - from - groups g $map_table - where - $where_clause - order by - name" + set result [db_list_of_lists users_get_result ""] + return $result } @@ -385,7 +288,7 @@ set sql [db_map users_get_paths] - uplevel "template::query users_get_paths $name multirow \{$sql\} -eval \{$eval_code\}" + uplevel "db_multirow $name users_get_paths \{$sql\} \{$eval_code\}" } @@ -406,13 +309,8 @@ set module_name [namespace tail [namespace current]] - template::query clip_get_result result multilist "select - :module_name as mount_point, - name, key, '' as children, - 'f' as expandable, - 'f' as symlink, - 0 as update_type - from cm_modules order by sort_key" + set result [db_multilist clip_get_result ""] + return $result }