Forum OpenACS Development: Re: fs::add_file Versus callback search::datasource

Collapse
Posted by Iuri Sampaio on
So far, debugging the callback call I've found the following info. The script fails in the line 52. As expected, the script is unable to find the correspondent query.

File file-storage-callback-procs.tcl Line 52

ad_proc -public -callback search::datasource -impl file_storage_object {} {
...

db_0or1row fs_datasource {} -column_array datasource

...

However, the query is there and works fine, when used directly in the file-storage pkg.

<fullquery name="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 else r.content end) as content, r.mime_type as mime, '' as keywords, i.storage_type as storage_type from cr_items i, cr_revisions r where r.item_id = i.item_id and r.revision_id = 43854

Furthermore, the datasource exists. Meaning, the execution of fs::add_file seems ti be working just fine.

object_id | title | content | mime | keywords | storage_type
-----------+----------+----------------------------+--------------------------+----------+--------------
43854 | campanha | [cr_fs_path]/43/85/3/43854 | application/octet-stream | | file
(1 row)

How would I make the callback aware of "No fullquery for dbqd.file-storage.tcl.file-storage-callback-procs.callback::search::datasource::impl::file_storage_object.fs_datasource" when fs::add_file is declared outside file-stroage package?

What is the fundamental concept, which I don't understand here?

Best wishes,