bm_folder_selection (public)

 bm_folder_selection user_id bookmark_id folder_p

Defined in packages/bookmarks/tcl/bookmarks-procs.tcl

This procedure is used to present a list of available folders to put bookmark or folder in.

Parameters:
user_id
bookmark_id
folder_p

Partial Call Graph (max 5 caller/called nodes):
%3 packages/bookmarks/www/folder-selection.tcl packages/bookmarks/ www/folder-selection.tcl bm_folder_selection bm_folder_selection packages/bookmarks/www/folder-selection.tcl->bm_folder_selection ad_conn ad_conn (public) bm_folder_selection->ad_conn db_map db_map (public) bm_folder_selection->db_map db_multirow db_multirow (public) bm_folder_selection->db_multirow

Testcases:
No testcase defined.
Source code:
    # We cannot move folders to be their own children
    if { $folder_p == "t" } {
    set exclude_folders [db_map exclude_folders]
    } else {
    set exclude_folders ""
    }

    set package_id [ad_conn package_id]

    db_multirow folders folder_select "
    select /*+INDEX(bm_bookmarks bm_bookmarks_local_title_idx)*/ bookmark_id, 
    local_title,
    level as indentation
    from   bm_bookmarks
    where folder_p = 't'
    and owner_id = :user_id
    and bookmark_id <> :bookmark_id
    and parent_id <> :package_id
    and acs_permission.permission_p(bookmark_id, :user_id, 'write') = 't'
    $exclude_folders
    start with parent_id = :package_id
    connect by prior bookmark_id = parent_id
    "
Generic XQL file:
packages/bookmarks/tcl/bookmarks-procs.xql

PostgreSQL XQL file:
<fullquery name="bm_folder_selection.folder_select">
    <querytext>
    select bm.bookmark_id, bm.local_title, tree_level(bm.tree_sortkey) as indentation
    from   bm_bookmarks bm, bm_bookmarks bm2
    where bm.tree_sortkey between bm2.tree_sortkey and tree_right(bm2.tree_sortkey)
      and bm2.parent_id = :package_id
      and bm2.owner_id = :user_id
      and bm.folder_p = 't'
      and bm.owner_id = :user_id
      and bm.bookmark_id <> :bookmark_id
      and bm.parent_id <> :package_id
      and acs_permission__permission_p(:bookmark_id, :user_id, 'write') = 't'
      $exclude_folders
    order by bm.tree_sortkey
      </querytext>
</fullquery>
packages/bookmarks/tcl/bookmarks-procs-postgresql.xql

Oracle XQL file:
<fullquery name="bm_folder_selection.folder_select">
    <querytext>
      
    select /*+INDEX(bm_bookmarks bm_bookmarks_local_title_idx)*/ bookmark_id, 
    local_title,
    level as indentation
    from   bm_bookmarks
    where folder_p = 't'
    and owner_id = :user_id
    and bookmark_id <> :bookmark_id
    and parent_id <> :package_id
    and acs_permission.permission_p(:bookmark_id, :user_id, 'write') = 't'
    $exclude_folders
    start with parent_id = :package_id
    connect by prior bookmark_id = parent_id
    
      </querytext>
</fullquery>
packages/bookmarks/tcl/bookmarks-procs-oracle.xql

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