Index: openacs-4/packages/file-storage/www/index-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/Attic/index-oracle.xql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/file-storage/www/index-oracle.xql 4 Dec 2001 04:59:48 -0000 1.4 +++ openacs-4/packages/file-storage/www/index-oracle.xql 21 Feb 2002 20:06:27 -0000 1.5 @@ -3,37 +3,38 @@ oracle8.1.6 - - - -select i.item_id as file_id, - i.name as name, - i.live_revision, - r.mime_type as type, - to_char(o.last_modified,'YYYY-MM-DD HH24:MI') as last_modified, - r.content_length as content_size, - 1 as ordering_key -from cr_items i, cr_revisions r, acs_objects o -where i.item_id = o.object_id -and i.live_revision = r.revision_id (+) -and i.parent_id = :folder_id -and acs_permission.permission_p(i.item_id, :user_id, 'read') = 't' -and i.content_type = 'content_revision' -UNION -select i.item_id as file_id, - f.label as name, - 0, - 'Folder', - NULL, - 0, - 0 -from cr_items i, cr_folders f -where i.item_id = f.folder_id -and i.parent_id = :folder_id -and acs_permission.permission_p(folder_id, :user_id, 'read') = 't' -order by ordering_key,name - - + + + select cr_items.item_id as file_id, + cr_items.name as name, + cr_items.live_revision, + cr_revisions.mime_type as type, + to_char(acs_objects.last_modified,'YYYY-MM-DD HH24:MI') as last_modified, + cr_revisions.content_length as content_size, + 1 as ordering_key + from cr_items, + cr_revisions, + acs_objects + where cr_items.parent_id = :folder_id + and cr_items.content_type = 'file_storage_object' + and 't' = acs_permission.permission_p(cr_items.item_id, :user_id, 'read') + and cr_items.item_id = acs_objects.object_id + and cr_items.live_revision = cr_revisions.revision_id (+) + UNION + select cr_items.item_id as file_id, + cr_folders.label as name, + 0 as live_revision, + 'Folder' as type, + NULL as last_modified, + 0 as content_size, + 0 as ordering_key + from cr_items, + cr_folders + where cr_items.parent_id = :folder_id + and cr_items.item_id = cr_folders.folder_id + and 't' = acs_permission.permission_p(cr_folders.folder_id, :user_id, 'read') + order by ordering_key, name + + -