fs::get_folder_package_and_root (public)

 fs::get_folder_package_and_root folder_id

Defined in packages/file-storage/tcl/file-storage-procs.tcl

Returns a two-element Tcl list containing the package_id and root_folder_id for the passed-in folder_id.

Parameters:
folder_id (required)
Author:
Andrew Grumet <aegrumet@alum.mit.edu>
Created:
15 March 2004

Partial Call Graph (max 5 caller/called nodes):
%3 test_fs_add_file_to_folder fs_add_file_to_folder (test file-storage) fs::get_folder_package_and_root fs::get_folder_package_and_root test_fs_add_file_to_folder->fs::get_folder_package_and_root db_1row db_1row (public) fs::get_folder_package_and_root->db_1row fs::add_created_version fs::add_created_version (public, deprecated) fs::add_created_version->fs::get_folder_package_and_root fs::add_version fs::add_version (public) fs::add_version->fs::get_folder_package_and_root fs::delete_file fs::delete_file (public) fs::delete_file->fs::get_folder_package_and_root fs::do_notifications fs::do_notifications (public) fs::do_notifications->fs::get_folder_package_and_root fs::notification::get_url fs::notification::get_url (private) fs::notification::get_url->fs::get_folder_package_and_root

Testcases:
fs_add_file_to_folder
Source code:

    db_1row select_package_and_root {}

    return [list $package_id $root_folder_id]
Generic XQL file:
packages/file-storage/tcl/file-storage-procs.xql

PostgreSQL XQL file:
<fullquery name="fs::get_folder_package_and_root.select_package_and_root">
    <querytext>
      With RECURSIVE items AS (
        select cr.item_id from cr_items cr where cr.item_id = :folder_id
      UNION ALL
        select cr.parent_id from cr_items cr, items where items.item_id = cr.item_id
      )
      select r.package_id, r.folder_id as root_folder_id
      from   items i, fs_root_folders r
      where  r.folder_id = i.item_id
    </querytext>
</fullquery>
packages/file-storage/tcl/file-storage-procs-postgresql.xql

Oracle XQL file:
<fullquery name="fs::get_folder_package_and_root.select_package_and_root">
    <querytext>
	select r.package_id,
               r.folder_id as root_folder_id
	from fs_root_folders r,
	     (select item_id as folder_id
              from cr_items
              connect by prior parent_id = item_id 
              start with item_id = :folder_id) t
        where r.folder_id = t.folder_id
    </querytext>
</fullquery>
packages/file-storage/tcl/file-storage-procs-oracle.xql

[ hide source ] | [ make this the default ]
Show another procedure: