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):
%3 packages/photo-album/www/album-add.tcl packages/photo-album/ www/album-add.tcl pa_context_bar_list pa_context_bar_list packages/photo-album/www/album-add.tcl->pa_context_bar_list packages/photo-album/www/album-chunk.tcl packages/photo-album/ www/album-chunk.tcl packages/photo-album/www/album-chunk.tcl->pa_context_bar_list packages/photo-album/www/album-delete.tcl packages/photo-album/ www/album-delete.tcl packages/photo-album/www/album-delete.tcl->pa_context_bar_list packages/photo-album/www/album-edit.tcl packages/photo-album/ www/album-edit.tcl packages/photo-album/www/album-edit.tcl->pa_context_bar_list packages/photo-album/www/album-move.tcl packages/photo-album/ www/album-move.tcl packages/photo-album/www/album-move.tcl->pa_context_bar_list db_1row db_1row (public) pa_context_bar_list->db_1row db_list_of_lists db_list_of_lists (public) pa_context_bar_list->db_list_of_lists pa_get_root_folder pa_get_root_folder (public) pa_context_bar_list->pa_get_root_folder

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_bar
Generic 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

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