Index: openacs-4/packages/cms/www/modules/sitemap/index-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/sitemap/index-postgresql.xql,v diff -u -r1.6 -r1.7 --- openacs-4/packages/cms/www/modules/sitemap/index-postgresql.xql 16 Nov 2004 22:32:50 -0000 1.6 +++ openacs-4/packages/cms/www/modules/sitemap/index-postgresql.xql 6 Apr 2005 00:20:59 -0000 1.7 @@ -3,56 +3,15 @@ postgresql7.1 - + - - select - r.item_id, '' as context, - case when o.object_type = 'content_symlink' then r.label - when o.object_type = 'content_folder' then f.label - else coalesce(v.title, i.name) end as title, - case when r.item_id = :index_page_id then 't' - else 'f' end as is_index_page, - coalesce(round(v.content_length::numeric / 1000.0, 2)::float8::text, '-') as file_size - from - cr_items i - LEFT OUTER JOIN - cr_revisions v ON i.latest_revision = v.revision_id - LEFT OUTER JOIN - cr_revisions u ON i.live_revision = u.revision_id - LEFT OUTER JOIN - cr_folders f ON i.item_id = f.folder_id, - cr_resolved_items r, acs_objects o, acs_object_types t - where - r.parent_id = $parent_var - and - r.resolved_id = i.item_id - and - i.item_id = o.object_id - and - i.content_type = t.object_type - order by - is_index_page desc $orderby_clause - - - - - - select - case when i.content_type = 'content_folder' then 't' else'f' end as is_folder, - case when i.content_type = 'content_template' then 't' else 'f' end as is_template, - r.item_id, r.resolved_id, r.is_symlink, r.name, + r.item_id, coalesce(trim( case when o.object_type = 'content_symlink' then r.label when o.object_type = 'content_folder' then f.label - else coalesce(v.title, i.name) end),'-') as title, - case when i.publish_status = 'live' then to_char(u.publish_date, 'MM/DD/YYYY') else '-' end as publish_date, - o.object_type, t.pretty_name as content_type, - to_char(o.last_modified, 'MM/DD/YYYY HH24:MI') as last_modified_date, - case when r.item_id = :index_page_id then 't' else 'f' end as is_index_page, - coalesce(round(v.content_length::numeric / 1000.0, 2)::float8::text, '-') as file_size + else coalesce(v.title, i.name) end),'-') as title from cr_items i LEFT OUTER JOIN @@ -70,30 +29,23 @@ i.item_id = o.object_id and i.content_type = t.object_type - and - -- paginator sql - r.item_id in (CURRENT_PAGE_SET) - order by - is_index_page desc $orderby_clause - + [template::list::orderby_clause -name folder_items -orderby] + - + select - case when i.content_type = 'content_folder' then 't' else'f' end as is_folder, - case when i.content_type = 'content_template' then 't' else 'f' end as is_template, - r.item_id, r.item_id as id, v.revision_id, r.resolved_id, r.is_symlink, r.name, i.parent_id, + r.item_id, r.item_id as id, v.revision_id, r.resolved_id, r.is_symlink, + r.name, i.parent_id, i.content_type, i.publish_status, u.publish_date, coalesce(trim( case when o.object_type = 'content_symlink' then r.label when o.object_type = 'content_folder' then f.label else coalesce(v.title, i.name) end),'-') as title, - case when i.publish_status = 'live' then to_char(u.publish_date, 'MM/DD/YYYY') else '-' end as publish_date, - o.object_type, t.pretty_name as content_type, - to_char(o.last_modified, 'MM/DD/YYYY HH24:MI') as last_modified_date, - coalesce(round(v.content_length::numeric / 1000.0, 2)::float8::text, '-') as file_size + o.object_type, t.pretty_name as pretty_content_type, last_modified, + v.content_length from cr_items i LEFT OUTER JOIN @@ -111,13 +63,16 @@ i.item_id = o.object_id and i.content_type = t.object_type + [template::list::page_where_clause -and -name folder_items -key r.item_id] + [template::list::orderby_clause -name folder_items -orderby] + - select content_symlink__resolve( :item_id ) + select content_symlink__resolve( :folder_id ) @@ -143,7 +98,7 @@ where i.item_id = s.target_id and - i.item_id = :original_id + i.item_id = :original_folder_id @@ -158,7 +113,7 @@ where i.item_id = f.folder_id and - f.folder_id = :item_id + f.folder_id = :folder_id