photo_album::list_albums_in_root_folder (public)

 photo_album::list_albums_in_root_folder \
    [ -root_folder_id root_folder_id ]

Defined in packages/photo-album/tcl/photo-album-procs.tcl

Returns a list of albums for a specific instance of photo-album

Switches:
-root_folder_id
(optional)

Partial Call Graph (max 5 caller/called nodes):
%3 ad_conn ad_conn (public) db_list_of_lists db_list_of_lists (public) photo_album::list_albums_in_root_folder photo_album::list_albums_in_root_folder photo_album::list_albums_in_root_folder->ad_conn photo_album::list_albums_in_root_folder->db_list_of_lists

Testcases:
No testcase defined.
Source code:
    # only return albums the current user can see
    set user_id [ad_conn user_id]
    return [db_list_of_lists list_albums {} ]
Generic XQL file:
packages/photo-album/tcl/photo-album-procs.xql

PostgreSQL XQL file:
<fullquery name="photo_album::list_albums_in_root_folder.list_albums">
    <querytext>
        select cr.title, ci1.item_id as album_id, ci1.tree_sortkey
    from cr_revisions cr, 
         (select ci.item_id, ci.live_revision, ci.tree_sortkey from
          cr_items ci, cr_items ci2
          where ci.content_type = 'pa_album'
          and ci.tree_sortkey between ci2.tree_sortkey and tree_right(ci2.tree_sortkey)
          and ci2.item_id = :root_folder_id) ci1
    where ci1.live_revision = cr.revision_id
    and acs_permission__permission_p(cr.revision_id, :user_id, 'read')
    order by cr.title
   </querytext>
</fullquery>
packages/photo-album/tcl/photo-album-procs-postgresql.xql

Oracle XQL file:
<fullquery name="photo_album::list_albums_in_root_folder.list_albums">
    <querytext>
        select cr.title, ci1.item_id as album_id
    from cr_revisions cr, (select ci.item_id, ci.live_revision, level as level_num from
          cr_items ci
          where content_type = 'pa_album'
          connect by prior ci.item_id=ci.parent_id
          start with ci.item_id = :root_folder_id) ci1
where ci1.live_revision = cr.revision_id
and exists (select 1
            from acs_object_party_privilege_map m
            where m.object_id = cr.revision_id
              and m.party_id = :user_id
              and m.privilege = 'read')
       order by level_num, cr.title
   </querytext>
</fullquery>
packages/photo-album/tcl/photo-album-procs-oracle.xql

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