Index: openacs-4/packages/cms/tcl/module-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/module-procs-postgresql.xql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/cms/tcl/module-procs-postgresql.xql 17 Aug 2001 02:53:47 -0000 1.4 +++ openacs-4/packages/cms/tcl/module-procs-postgresql.xql 20 Aug 2001 04:35:41 -0000 1.5 @@ -2,9 +2,61 @@ postgresql7.1 - - + + + + select + o.object_id as item_id, + o.object_type || ': ' || acs_object__name(o.object_id) as item_path, + o.object_type as item_type + from + acs_objects o, parties p + where + o.object_id = p.party_id + and + o.object_id in ($sql_id_list) + order by + item_path + + + + + + + + + select + item_id, + content_item__get_path(item_id, :sorted_paths_root_id) as item_path, + content_type as item_type + from + cr_items + where + item_id in ($sql_id_list) + order by item_path + + + + + + + + + select + keyword_id as item_id, + content_keyword__get_path(keyword_id) as item_path, + 'content_keyword' as item_type + from + cr_keywords + where + keyword_id in ($sql_id_list) + + + + + + select :mount_point as mount_point, @@ -14,7 +66,7 @@ coalesce((select 't'::text 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'::text) as expandable, + and f_child.folder_id = r_child.resolved_id)), 'f') as expandable, r.is_symlink as symlink, 0 as update_time from @@ -29,52 +81,53 @@ - + select content_template__get_root_folder() - + select content_item__get_root_folder(null) - + - FIX ME CONNECT BY select - lpad(' ', level, '-') || pretty_name as label, + lpad(' ', tree_level(t.tree_sortkey), '-') || 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' + where + t.tree_sortkey like (select tree_sortkey || '%' + from acs_object_types + where object_type = 'content_revision') - - + + - select + select :module_name as mount_point, t.pretty_name, t.object_type, '' as children, - ( CASE WHEN - (select count(*) from acs_object_types - where supertype = t.object_type) = 0 - THEN 'f' ELSE 't' END ) as expandable, + coalesce( + (select 't'::text + where exists (select 1 from acs_object_types + where supertype = t.object_type)), + 'f' + ) as expandable, 'f' as symlink, 0 as update_time from @@ -83,61 +136,19 @@ supertype = :id order by t.pretty_name - - + - - select - :module_name as mount_point, - content_keyword__get_heading(keyword_id) as name, - keyword_id, - '' as children, - (CASE WHEN ( - select 1 from cr_keywords k2 - where k2.parent_id = k.keyword_id - and content_keyword__is_leaf(k2.keyword_id) = 'f') - ) = 1 THEN 't' ELSE 'f' END - ) 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 - - - - - - select - item_id, - content_item__get_path(item_id, :sorted_paths_root_id) as item_path, - content_type as item_type - from - cr_items - where - item_id in ($sql_id_list) - order by item_path - - - - - - select + select :module_name as mount_point, content_keyword__get_heading(keyword_id) as name, keyword_id, '' as children, - coalesce( (select 't'::text from dual + coalesce( (select 't'::text where exists ( select 1 from cr_keywords k2 where k2.parent_id = k.keyword_id @@ -153,53 +164,19 @@ content_keyword__is_leaf(keyword_id) = 'f' order by name - + + + + - - - - select - keyword_id as item_id, - content_keyword__get_path(keyword_id) as item_path, - 'content_keyword' as item_type - from - cr_keywords - where - keyword_id in ($sql_id_list) - - - - - - - - select - o.object_id as item_id, - o.object_type || ': ' || acs_object__name(o.object_id) as item_path, - o.object_type as item_type - from - acs_objects o, parties p - where - o.object_id = p.party_id - and - o.object_id in ($sql_id_list) - order by - item_path - - - - - - - - select + select :module_name as mount_point, g.group_name as name, g.group_id, '' as children, coalesce( - (select 't'::text from dual + (select 't'::text where exists ( select 1 from group_component_map m2 where m2.group_id = g.group_id)), @@ -213,8 +190,8 @@ $where_clause order by name - - + +