Index: openacs-4/packages/file-storage/tcl/file-storage-search-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/tcl/file-storage-search-procs.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/file-storage/tcl/file-storage-search-procs.tcl 7 Aug 2017 23:48:11 -0000 1.6 +++ openacs-4/packages/file-storage/tcl/file-storage-search-procs.tcl 3 Sep 2024 15:37:38 -0000 1.7 @@ -1,4 +1,4 @@ -ad_library { +ad_library { Site-wide search procs for file storage Implements OpenFTS Search service contracts @@ -7,18 +7,18 @@ @cvs-id $Id$ } -ad_proc fs__datasource { +ad_proc -private fs__datasource { revision_id } { @author Jowell S. Sabino (jowellsabino@netscape.net) } { - - db_0or1row fs_datasource " + + db_0or1row fs_datasource { select r.revision_id as object_id, i.name as title, case i.storage_type when 'lob' then r.lob::text - when 'file' then '[cr_fs_path]' || r.content + when 'file' then r.content else r.content end as content, r.mime_type as mime, @@ -27,12 +27,16 @@ from cr_items i, cr_revisions r where r.item_id = i.item_id and r.revision_id = :revision_id - " -column_array datasource - + } -column_array datasource + + if {$storage_type eq "file"} { + set datasource(content) [content::revision::get_cr_file_path -revision_id $object_id] + } + return [array get datasource] } - -ad_proc fs__url { + +ad_proc -private fs__url { revision_id } { @author Jowell S. Sabino (jowellsabino@netscape.net) @@ -46,7 +50,7 @@ where children.item_id = r.item_id and r.revision_id = $revision_id and children.tree_sortkey - between parent.tree_sortkey + between parent.tree_sortkey and tree_right(parent.tree_sortkey) ) as i where f.folder_id = i.parent_id "