install::xml::action::map-category-tree (public)

 install::xml::action::map-category-tree node

Defined in packages/categories/tcl/install-procs.tcl

Maps a category tree to a specified object.

Parameters:
node

Partial Call Graph (max 5 caller/called nodes):
%3 acs_object_type acs_object_type (public) apm_attribute_value apm_attribute_value (public) apm_invoke_install_proc apm_invoke_install_proc (public) category::get_tree category::get_tree (public) category_tree::map category_tree::map (public) install::xml::action::map-category-tree install::xml::action::map-category-tree install::xml::action::map-category-tree->acs_object_type install::xml::action::map-category-tree->apm_attribute_value install::xml::action::map-category-tree->apm_invoke_install_proc install::xml::action::map-category-tree->category::get_tree install::xml::action::map-category-tree->category_tree::map

Testcases:
No testcase defined.
Source code:
    set tree_id [apm_attribute_value -default "" $node tree-id]
    set object_id [apm_attribute_value -default "" $node object-id]

    set tree_ids [list]
    if {$tree_id eq ""} {
        set trees_node [lindex [xml_node_get_children_by_name $node trees] 0]
        set trees [xml_node_get_children $trees_node]

        foreach tree_node $trees {
            lappend tree_ids [apm_invoke_install_proc  -type object_id  -node $tree_node]
        }
    } else {
        lappend tree_ids [install::xml::util::get_id $tree_id]
    }

    set object_ids [list]
    if {$object_id eq ""} {
        set objects_node [lindex [xml_node_get_children_by_name $node objects] 0]
        set objects [xml_node_get_children $objects_node]

        foreach object_node $objects {
            lappend object_ids [apm_invoke_install_proc  -type object_id  -node $object_node]
        }
    } else {
        lappend object_ids [install::xml::util::get_id $object_id]
    }

    foreach tree_id $tree_ids {
        if {[acs_object_type $tree_id] eq "category"} {
            set subtree_category_id $tree_id
            set tree_id [category::get_tree $subtree_category_id]
        } else {
            set subtree_category_id {}
        }

        foreach object_id $object_ids {
            category_tree::map -tree_id $tree_id  -object_id $object_id  -subtree_category_id $subtree_category_id
        }
    }
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: