- Publicity: Public Only All
site-nodes-procs.tcl
Site node API
- Location:
- packages/acs-tcl/tcl/site-nodes-procs.tcl
- Authors:
- rhs@mit.edu
- yon (yon@openforce.net), Gustaf Neumann
Procedures in this file
- site_node::closest_ancestor_package (public)
- site_node::delete (public)
- site_node::delete_service_nodes (public)
- site_node::exists_p (public)
- site_node::get (public)
- site_node::get_all_from_object_id (public)
- site_node::get_ancestors (public)
- site_node::get_children (public)
- site_node::get_element (public)
- site_node::get_from_node_id (public)
- site_node::get_from_object_id (public)
- site_node::get_from_url (public)
- site_node::get_node_id (public)
- site_node::get_node_id_from_object_id (public)
- site_node::get_object_id (public)
- site_node::get_package_url (public)
- site_node::get_parent (public)
- site_node::get_parent_id (public)
- site_node::get_url (public)
- site_node::get_url_from_object_id (public)
- site_node::instantiate_and_mount (public)
- site_node::mount (public)
- site_node::new (public)
- site_node::rename (public)
- site_node::unmount (public)
- site_node::update_cache (public)
- site_node::verify_folder_name (public)
Detailed information
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 ]
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
(boolean) (optional)- Return the package_id at the passed-in node if it is of the desired package_key. Ignored if package_key is empty.
- -element
(defaults to"object_id"
) (optional)- 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
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- site_node_closest_ancestor_package
site_node::delete (public)
site_node::delete -node_id node_id [ -delete_subnodes ] \ [ -delete_package ]
delete the site node
- Switches:
- -node_id
(required)- -delete_subnodes
(boolean) (optional)- -delete_package
(boolean) (optional)- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- site_node_update_cache, xowiki_test_cases, slot_interactions, path_resolve
site_node::delete_service_nodes (public)
site_node::delete_service_nodes -node_id node_id
Unmount and delete all (shared) service packages under this site_node.
- Switches:
- -node_id
(required)- starting node_id
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
site_node::exists_p (public)
site_node::exists_p -url url
Returns 1 if a site node exists at the given url and 0 otherwise.
- Switches:
- -url
(required)- URL path starting with a slash.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- site_node_verify_folder_name, xowiki_test_cases
site_node::get (public)
site_node::get [ -url url ] [ -node_id node_id ]
Returns an array representing the site node that matches the given url. Either url or node_id is required, if both are passed url is ignored. The array elements are: package_id, package_key, object_type, directory_p, instance_name, pattern_p, parent_id, node_id, object_id, url.
- Switches:
- -url
(optional)- -node_id
(optional)- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- acs_admin_require_site_wide, ad_context_bar, ad_context_bar_multirow, site_node_update_cache, oacs_dav_put, oacs_dav_mkcol, xowiki_test_cases
site_node::get_all_from_object_id (public)
site_node::get_all_from_object_id -object_id object_id
Return a list of site node info associated with the given object_id. The nodes will be ordered descendingly by url (children before their parents).
- Switches:
- -object_id
(required)- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
site_node::get_ancestors (public)
site_node::get_ancestors -node_id node_id [ -element element ]
- Switches:
- -node_id
(required)- -element
(optional)- Returns:
- the ancestors of this node
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
site_node::get_children (public)
site_node::get_children [ -all ] [ -package_type package_type ] \ [ -package_key package_key ] [ -filters filters ] \ [ -element element ] -node_id node_id
This proc gives answers to questions such as: What are all the package_id's (or any of the other available elements) for all the instances of package_key or package_type mounted under node_id xxx?
- Switches:
- Options:
- -all
(boolean) (optional)- -package_type
(optional)- -package_key
(optional)- If specified, this will limit the returned nodes to those with a package of the specified package key mounted. Conflicts with the -package_type option. Can take one or more packages keys as a Tcl list.
- -filters
(optional)- Takes a list of { element value element value ... } for filtering the result list. Only nodes where element is value for each of the filters in the list will get included. For example: -filters { package_key "acs-subsite" }.
- -element
(optional)- The element of the site node you wish returned. Defaults to url, but the following elements are available: object_type, url, object_id, instance_name, package_type, package_id, name, node_id, directory_p.
- -node_id
(required)- The node for which you want to find the children.
- -all
- Set this if you want all children, not just direct children
- -package_type
- If specified, this will limit the returned nodes to those with a package of the specified package type (normally apm_service or apm_application) mounted. Conflicts with the -package_key option.
- Returns:
- A list of URLs of the site_nodes immediately under this site node, or all children, if the -all switch is specified.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- site_node_get_children, site_node_verify_folder_name
site_node::get_element (public)
site_node::get_element [ -node_id node_id ] [ -url url ] \ -element element
returns an element from the array representing the site node that matches the given url either url or node_id is required, if both are passed url is ignored The array elements are: package_id, package_key, object_type, directory_p, instance_name, pattern_p, parent_id, node_id, object_id, url.
- Switches:
- -node_id
(optional)- -url
(optional)- -element
(required)- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- site_node_verify_folder_name
site_node::get_from_node_id (public)
site_node::get_from_node_id -node_id node_id
returns an array representing the site node for the given node_id
- Switches:
- -node_id
(required)- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
site_node::get_from_object_id (public)
site_node::get_from_object_id -object_id object_id
return the site node associated with the given object_id WARNING: Returns only the first site node associated with this object.
- Switches:
- -object_id
(required)- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- subsite_api
site_node::get_from_url (public)
site_node::get_from_url -url url [ -exact ]
Returns an array representing the site node that matches the given url. A trailing '/' will be appended to $url if required and not present. If the '-exact' switch is not present and $url is not found, returns the first match found by successively removing the trailing $url path component.
- Switches:
- -url
(required)- -exact
(boolean) (optional)- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- acs_subsite_expose_bug_1144, front_page_1, xowiki_test_cases
site_node::get_node_id (public)
site_node::get_node_id -url url
- Switches:
- -url
(required)- Returns:
- the node_id for this url
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- site_node_get_children, site_node_verify_folder_name, site_node_update_cache, site_node_closest_ancestor_package, slot_interactions, path_resolve
site_node::get_node_id_from_object_id (public)
site_node::get_node_id_from_object_id -object_id object_id
- Switches:
- -object_id
(required)- Returns:
- the site node id associated with the given object_id
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
site_node::get_object_id (public)
site_node::get_object_id -node_id node_id
- Switches:
- -node_id
(required)- Returns:
- the object_id for this node
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
site_node::get_package_url (public)
site_node::get_package_url -package_key package_key
Get the URL of any mounted instance of a package with the given package_key. If there is more than one mounted instance of a package, returns the first URL. To see all of the mounted URLs, use the site_node::get_children proc.
- Switches:
- -package_key
(required)- Returns:
- a URL, or empty string if no instance of the package is mounted.
- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
site_node::get_parent (public)
site_node::get_parent -node_id node_id
- Switches:
- -node_id
(required)- Returns:
- the parent node of this node
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
site_node::get_parent_id (public)
site_node::get_parent_id -node_id node_id
- Switches:
- -node_id
(required)- Returns:
- the parent_id of this node
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
site_node::get_url (public)
site_node::get_url -node_id node_id [ -notrailing ]
return the url of this node_id
- Switches:
- -node_id
(required)- -notrailing
(boolean) (optional)- If true then strip any trailing slash ('/'). This means the empty string is returned for the root.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- site_node_update_cache
site_node::get_url_from_object_id (public)
site_node::get_url_from_object_id -object_id object_id
Returns a list of URLs for site_nodes that have the given object mounted or the empty list if there are none. The url:s will be returned in descending order meaning any children will come before their parents. This ordering is useful when deleting site nodes as we must delete child site nodes before their parents.
- Switches:
- -object_id
(required)- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- site_node_update_cache, package_normalize_path, xowiki_test_cases, link_tests, slot_interactions, path_resolve
site_node::instantiate_and_mount (public)
site_node::instantiate_and_mount [ -node_id node_id ] \ [ -parent_node_id parent_node_id ] [ -node_name node_name ] \ [ -package_name package_name ] [ -context_id context_id ] \ -package_key package_key [ -package_id package_id ]
Instantiate and mount a package of given type. Will use an existing site node if possible.
- Switches:
- -node_id
(optional)- The id of the node in the site map where the package should be mounted.
- -parent_node_id
(optional)- If no node_id is specified this will be the parent node under which the new node is created. Defaults to the main site node id.
- -node_name
(optional)- If node_id is not specified then this will be the name of the new site node that is created. Defaults to package_key.
- -package_name
(optional)- The name of the new package instance. Defaults to pretty name of package type.
- -context_id
(optional)- The context_id of the package. Defaults to the closest ancestor package in the site map.
- -package_key
(required)- The key of the package type to instantiate.
- -package_id
(optional)- The id of the new package. Optional.
- Returns:
- The id of the instantiated package
- Author:
- Peter Marklund
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- subsite_api, site_node_update_cache, site_node_closest_ancestor_package, ad_proc_permission_grant_and_revoke, ad_proc_permission_permission_p, test_inheritance_and_custom_permissions, fs_publish_file, xowiki_test_cases
site_node::mount (public)
site_node::mount -node_id node_id -object_id object_id \ [ -context_id context_id ]
mount object at site node
- Switches:
- -node_id
(required)- -object_id
(required)- -context_id
(optional)- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- ad_context_bar
site_node::new (public)
site_node::new -name name -parent_id parent_id \ [ -directory_p directory_p ] [ -pattern_p pattern_p ]
Create a new site node
- Switches:
- -name
(required)- -parent_id
(required)- -directory_p
(defaults to"t"
) (optional)- -pattern_p
(defaults to"t"
) (optional)- Returns:
- node_id
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- ad_context_bar, site_node_closest_ancestor_package
site_node::rename (public)
site_node::rename -node_id node_id -name name
Rename the site node.
- Switches:
- -node_id
(required)- -name
(required)- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- site_node_update_cache
site_node::unmount (public)
site_node::unmount -node_id node_id
unmount an object from the site node
- Switches:
- -node_id
(required)- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- site_node_update_cache, xowiki_test_cases, slot_interactions, path_resolve
site_node::update_cache (public)
site_node::update_cache [ -sync_children ] -node_id node_id \ [ -url url ] [ -object_id object_id ]
Brings the in-memory copy of the site nodes hierarchy in sync with the database version. Only updates the given node and its children.
- Switches:
- -sync_children
(boolean) (optional)- -node_id
(required)- -url
(optional)- -object_id
(optional)- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
site_node::verify_folder_name (public)
site_node::verify_folder_name -parent_node_id parent_node_id \ [ -current_node_id current_node_id ] \ [ -instance_name instance_name ] [ -folder folder ]
Verifies that the given folder name is valid for a folder under the given parent_node_id. If current_node_id is supplied, it's assumed that we're renaming an existing node, not creating a new one. If folder name is not supplied, we'll generate one from the instance name, which must then be supplied.
- Switches:
- -parent_node_id
(required)- -current_node_id
(optional)- -instance_name
(optional)- -folder
(optional)- Returns:
- folder name, or empty string if the supplied folder name wasn't acceptable.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- site_node_verify_folder_name