fs_context_bar_list (public)

 fs_context_bar_list [ -root_folder_id root_folder_id ] \
    [ -final final ] [ -folder_url folder_url ] [ -file_url file_url ] \
    [ -extra_vars extra_vars ] item_id

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

Constructs the list to be fed to ad_context_bar appropriate for item_id. If -final is specified, that string will be the last item in the context bar. Otherwise, the name corresponding to item_id will be used.

Switches:
-root_folder_id (optional)
-final (optional)
-folder_url (optional, defaults to "index")
-file_url (optional, defaults to "file")
-extra_vars (optional)
Parameters:
item_id (required)

Partial Call Graph (max 5 caller/called nodes):
%3 test_attachments_url_api attachments_url_api (test attachments) fs_context_bar_list fs_context_bar_list test_attachments_url_api->fs_context_bar_list test_fs_add_file_to_folder fs_add_file_to_folder (test file-storage) test_fs_add_file_to_folder->fs_context_bar_list test_fs_create_folder fs_create_folder (test file-storage) test_fs_create_folder->fs_context_bar_list test_fs_edit_folder fs_edit_folder (test file-storage) test_fs_edit_folder->fs_context_bar_list db_exec_plsql db_exec_plsql (public) fs_context_bar_list->db_exec_plsql db_list_of_lists db_list_of_lists (public) fs_context_bar_list->db_list_of_lists db_string db_string (public) fs_context_bar_list->db_string fs_get_root_folder fs_get_root_folder (public) fs_context_bar_list->fs_get_root_folder attachments::context_bar attachments::context_bar (public) attachments::context_bar->fs_context_bar_list packages/file-storage/www/admin/rss-subscr-ae.tcl packages/file-storage/ www/admin/rss-subscr-ae.tcl packages/file-storage/www/admin/rss-subscr-ae.tcl->fs_context_bar_list packages/file-storage/www/admin/rss-subscrs.tcl packages/file-storage/ www/admin/rss-subscrs.tcl packages/file-storage/www/admin/rss-subscrs.tcl->fs_context_bar_list packages/file-storage/www/file-add.tcl packages/file-storage/ www/file-add.tcl packages/file-storage/www/file-add.tcl->fs_context_bar_list packages/file-storage/www/file-edit.tcl packages/file-storage/ www/file-edit.tcl packages/file-storage/www/file-edit.tcl->fs_context_bar_list

Testcases:
attachments_url_api, fs_create_folder, fs_edit_folder, fs_add_file_to_folder
Source code:
    if {$root_folder_id eq ""} {
        set root_folder_id [fs_get_root_folder]
    }

    if {$final eq ""
        && !($item_id == $root_folder_id)
    } {
        # don't get title for last element if we are in the
        # root folder
        set start_id [db_string parent_id {
            select parent_id from cr_items where item_id = :item_id
        }]
        set final [db_exec_plsql title {}]
    } else {
        set start_id $item_id
    }

    set extra_vars [concat &$extra_vars]

    set context_bar [db_list_of_lists context_bar {}]
    if {$item_id != $root_folder_id} {
        lappend context_bar $final
    }
    return $context_bar
Generic XQL file:
<fullquery name="fs_context_bar_list.parent_id">
    <querytext>
            select parent_id
            from cr_items
            where item_id = :item_id
        </querytext>
</fullquery>
packages/file-storage/tcl/file-storage-procs.xql

PostgreSQL XQL file:
<fullquery name="fs_context_bar_list.title">
    <querytext>
            select file_storage__get_title(:item_id)
        </querytext>
</fullquery>

<fullquery name="fs_context_bar_list.context_bar">
    <querytext>
            select (case when file_storage__get_content_type(i.item_id) = 'content_folder'
                         then :folder_url || '?folder_id='
                         else :file_url || '?file_id='
                    end) || i.item_id || :extra_vars,
                   file_storage__get_title(i.item_id)
            from (select tree_ancestor_keys(cr_items_get_tree_sortkey(:start_id)) as tree_sortkey) parents,
                 (select tree_sortkey from cr_items where item_id = :root_folder_id) root,
                 cr_items i
            where i.tree_sortkey = parents.tree_sortkey
            and i.tree_sortkey > root.tree_sortkey
            order by i.tree_sortkey asc
        </querytext>
</fullquery>
packages/file-storage/tcl/file-storage-procs-postgresql.xql

Oracle XQL file:
<fullquery name="fs_context_bar_list.title">
    <querytext>
            begin
                :1 := file_storage.get_title(:item_id);
            end;
        </querytext>
</fullquery>

<fullquery name="fs_context_bar_list.context_bar">
    <querytext>
            select case when file_storage.get_content_type(i.item_id) = 'content_folder'
                        then :folder_url || '?folder_id='
                        else :file_url || '?file_id='
                   end || i.item_id || :extra_vars,  
                   file_storage.get_title(i.item_id)
            from cr_items i
            where item_id not in (select i2.item_id
                                  from cr_items i2
                                  connect by prior i2.parent_id = i2.item_id
                                  start with i2.item_id = :root_folder_id)
            connect by prior i.parent_id = i.item_id
            start with item_id = :start_id
            order by level desc
        </querytext>
</fullquery>
packages/file-storage/tcl/file-storage-procs-oracle.xql

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