fs::get_folder_contents_count (public)

 fs::get_folder_contents_count [ -folder_id folder_id ] \
    [ -user_id user_id ]

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

Retrieve the count of contents of the specified folder.

Switches:
-folder_id (optional)
The folder for which to retrieve contents
-user_id (optional)
DEPRECATED since commit 2002-02-22 by Yonatan Feldman (yon@milliped.com) this parameter doesn't have any effect. It was used to count only items where user had read permission, but was considered unscalable.

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_contents_count fs::get_folder_contents_count test_fs_add_file_to_folder->fs::get_folder_contents_count ad_conn ad_conn (public) fs::get_folder_contents_count->ad_conn db_string db_string (public) fs::get_folder_contents_count->db_string fs::get_root_folder fs::get_root_folder (public) fs::get_folder_contents_count->fs::get_root_folder packages/attachments/www/attach.tcl packages/attachments/ www/attach.tcl packages/attachments/www/attach.tcl->fs::get_folder_contents_count packages/file-storage/www/folder-delete.tcl packages/file-storage/ www/folder-delete.tcl packages/file-storage/www/folder-delete.tcl->fs::get_folder_contents_count packages/file-storage/www/index.tcl packages/file-storage/ www/index.tcl packages/file-storage/www/index.tcl->fs::get_folder_contents_count

Testcases:
fs_add_file_to_folder
Source code:
    if {$folder_id eq ""} {
        set folder_id [get_root_folder -package_id [ad_conn package_id]]
    }

    if {$user_id ne ""} {
        ns_log warning "fs::get_folder_contents_count:"  "specified -user_id doesn't have any effect on proc result"
    }

    return [db_string select_folder_contents_count {}]
Generic XQL file:
<fullquery name="fs::get_folder_contents_count.select_folder_contents_count">
    <querytext>
            select count(*)
            from fs_objects
            where parent_id = :folder_id
        </querytext>
</fullquery>
packages/file-storage/tcl/file-storage-procs.xql

PostgreSQL XQL file:
packages/file-storage/tcl/file-storage-procs-postgresql.xql

Oracle XQL file:
packages/file-storage/tcl/file-storage-procs-oracle.xql

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