application_group::closest_ancestor_application_group_site_node (public)
application_group::closest_ancestor_application_group_site_node \ [ -url url ] [ -node_id node_id ] [ -include_self ]
Defined in packages/acs-subsite/tcl/application-group-procs.tcl
Starting with the node with the given node_id (or URL), climb up the site map and return the node of the first non null application group
- Switches:
- -url (optional)
- The URL of the node to start from. You must provide either URL or node_id. An empty URL is taken to mean the main site.
- -node_id (optional)
- The id of the node to start from. Takes precedence over any provided URL.
- -include_self (optional, boolean)
- If true, include the current package in the search
- Returns:
- The node of the first non-null application group in array get format.
- Author:
- Peter Marklund, Dave Bauer
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- subsite_api
Source code: # Make sure we have a URL to work with if { $url eq "" } { if { $node_id eq "" } { set url "/" } else { set url [site_node::get_url -node_id $node_id] } } set group_id "" while {$group_id eq "" && $url ne ""} { if { $include_self_p } { array set node_array [site_node::get -url $url] set group_id [application_group::group_id_from_package_id -package_id $node_array(package_id) -no_complain] } set include_self_p 1 # move up a level set url [string trimright $url /] set url [string range $url 0 [string last / $url]] } if {$group_id eq ""} { array unset -no_complain node_array } set node_array(application_group_id) $group_id return [array get node_array]XQL Not present: Generic PostgreSQL XQL file: packages/acs-subsite/tcl/application-group-procs-postgresql.xql
Oracle XQL file: packages/acs-subsite/tcl/application-group-procs-oracle.xql