photo_album::photo::package_url (public)

 photo_album::photo::package_url [ -photo_id photo_id ]

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

given a photo_id (can be an item or revision_id) return the package_url for the corresponding photo. does not include the site part just the path.

Switches:
-photo_id
(optional)

Partial Call Graph (max 5 caller/called nodes):
%3 photo_album::search::photo::datasource photo_album::search::photo::datasource (private) photo_album::photo::package_url photo_album::photo::package_url photo_album::search::photo::datasource->photo_album::photo::package_url db_0or1row db_0or1row (public) photo_album::photo::package_url->db_0or1row site_node::get_element site_node::get_element (public) photo_album::photo::package_url->site_node::get_element

Testcases:
No testcase defined.
Source code:
 
    db_0or1row package_url {}

    return [site_node::get_element -node_id $node_id -element url]
Generic XQL file:
packages/photo-album/tcl/photo-album-procs.xql

PostgreSQL XQL file:
<fullquery name="photo_album::photo::package_url.package_url">
    <querytext>
        SELECT n.node_id, i1.item_id
        FROM cr_items i1, cr_items i2, pa_package_root_folder_map m, site_nodes n
        WHERE m.folder_id = i2.item_id
          and i1.item_id = coalesce((select item_id from cr_revisions where revision_id = :photo_id),:photo_id)
          and n.object_id = m.package_id
          and i1.tree_sortkey between i2.tree_sortkey and tree_right(i2.tree_sortkey)
        limit 1
    </querytext>
</fullquery>
packages/photo-album/tcl/photo-album-procs-postgresql.xql

Oracle XQL file:
<fullquery name="photo_album::photo::package_url.package_url">
    <querytext>
        SELECT n.node_id, item_id
        FROM cr_items, pa_package_root_folder_map m, site_nodes n
        WHERE m.folder_id = item_id
          and item_id = nvl((select item_id from cr_revisions where revision_id = :photo_id),:photo_id)
          and n.object_id = m.package_id
        connect by prior cr_items.parent_id = item_id
        and rownum = 1
    </querytext>
</fullquery>
packages/photo-album/tcl/photo-album-procs-oracle.xql

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