site_node::closest_ancestor_package (public)

 site_node::closest_ancestor_package [ -url url ] [ -node_id node_id ] \
    [ -package_key package_key ] [ -include_self ] \
    [ -element element ]

Defined in packages/acs-tcl/tcl/site-nodes-procs.tcl

Starting with the node of the given id, or at given url, climb up the site map and return the id of the first not-null mounted object. If no ancestor object is found the empty string is returned. Will ignore itself and only return true ancestors unless include_self is set.

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.
-package_key (optional)
Restrict search to objects of this package type. You may supply a list of package_keys.
-include_self (optional, boolean)
Return the package_id at the passed-in node if it is of the desired package_key. Ignored if package_key is empty.
-element (optional, defaults to "object_id")
Returns:
The id of the first object found and an empty string if no object is found. Throws an error if no node with given url can be found.
Author:
Peter Marklund

Testcases:
site_node_closest_ancestor_package
[ show source ]
Show another procedure: