pa_context_bar_list (public)
pa_context_bar_list [ -final final ] item_id
Defined in packages/photo-album/tcl/photo-album-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. modified from fs_context_bar
- Switches:
- -final (optional)
- Parameters:
- item_id (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: set root_folder_id [pa_get_root_folder] if {$item_id == $root_folder_id} { if {$final ne ""} { return [list $final] } else { return {} } } if {$final eq ""} { # set start_id and final with a single trip to the database db_1row get_start_and_final "select parent_id as start_id, content_item.get_title(item_id,'t') as final from cr_items where item_id = :item_id" #set start_id [db_string parent_id " #select parent_id from cr_items where item_id = :item_id"] #set final [db_string title "select content_item.get_title(:item_id,'t') from dual"] } else { set start_id $item_id } if {$start_id != $root_folder_id} { set context_bar [db_list_of_lists context_bar " select decode( content_item.get_content_type(i.item_id), 'content_folder', 'index?folder_id=', 'pa_album', 'album?album_id=', 'photo?photo_id=' ) || i.item_id, content_item.get_title(i.item_id,'t') from cr_items i connect by prior i.parent_id = i.item_id and i.item_id != :root_folder_id start with item_id = :start_id order by level desc"] } lappend context_bar $final return $context_barGeneric XQL file: packages/photo-album/tcl/photo-album-procs.xql
PostgreSQL XQL file: <fullquery name="pa_context_bar_list.get_start_and_final"> <querytext> select parent_id as start_id, content_item__get_title(item_id,'t') as final from cr_items where item_id = :item_id </querytext> </fullquery> <fullquery name="pa_context_bar_list.context_bar"> <querytext> select case when content_item__get_content_type(i.item_id) = 'content_folder' then 'index?folder_id=' when content_item__get_content_type(i.item_id) = 'pa_album' then 'album?album_id=' else 'photo?photo_id=' end || i.item_id, content_item__get_title(i.item_id,'t') from cr_items i, (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) as root where i.tree_sortkey = parents.tree_sortkey and i.tree_sortkey > root.tree_sortkey order by i.tree_sortkey asc </querytext> </fullquery>packages/photo-album/tcl/photo-album-procs-postgresql.xql
Oracle XQL file: <fullquery name="pa_context_bar_list.get_start_and_final"> <querytext> select parent_id as start_id, content_item.get_title(item_id,'t') as final from cr_items where item_id = :item_id </querytext> </fullquery> <fullquery name="pa_context_bar_list.context_bar"> <querytext> select decode( content_item.get_content_type(i.item_id), 'content_folder', 'index?folder_id=', 'pa_album', 'album?album_id=', 'photo?photo_id=' ) || i.item_id, content_item.get_title(i.item_id,'t') from cr_items i connect by prior i.parent_id = i.item_id and i.item_id != :root_folder_id start with item_id = :start_id order by level desc </querytext> </fullquery>packages/photo-album/tcl/photo-album-procs-oracle.xql