bug_tracker::install_keywords_setup (public)

 bug_tracker::install_keywords_setup [ -package_id package_id ] \
    -spec spec

Defined in packages/bug-tracker/tcl/bug-tracker-procs.tcl

Switches:
-package_id (optional)
-spec (required)
is an array-list of { Type1 { cat1 cat2 cat3 } Type2 { cat1 cat2 cat3 } } Default category within type is denoted by letting the name start with a *, which is removed before creating the keyword.

Partial Call Graph (max 5 caller/called nodes):
%3 packages/bug-tracker/www/admin/category-defaults.tcl packages/bug-tracker/ www/admin/category-defaults.tcl bug_tracker::install_keywords_setup bug_tracker::install_keywords_setup packages/bug-tracker/www/admin/category-defaults.tcl->bug_tracker::install_keywords_setup packages/bug-tracker/www/admin/initial-setup.tcl packages/bug-tracker/ www/admin/initial-setup.tcl packages/bug-tracker/www/admin/initial-setup.tcl->bug_tracker::install_keywords_setup bug_tracker::conn bug_tracker::conn (public) bug_tracker::install_keywords_setup->bug_tracker::conn bug_tracker::get_keywords_flush bug_tracker::get_keywords_flush (private) bug_tracker::install_keywords_setup->bug_tracker::get_keywords_flush bug_tracker::set_default_keyword bug_tracker::set_default_keyword (public) bug_tracker::install_keywords_setup->bug_tracker::set_default_keyword content::keyword::get_keyword_id content::keyword::get_keyword_id (public) bug_tracker::install_keywords_setup->content::keyword::get_keyword_id content::keyword::new content::keyword::new (public) bug_tracker::install_keywords_setup->content::keyword::new

Testcases:
No testcase defined.
Source code:
    set root_keyword_id [bug_tracker::conn project_root_keyword_id -package_id $package_id]

    foreach { category_type categories } $spec {
        set category_type_id [content::keyword::get_keyword_id  -parent_id $root_keyword_id  -heading $category_type]

        if { $category_type_id eq "" } {
            set category_type_id [content::keyword::new  -parent_id $root_keyword_id  -heading $category_type]
        }

        foreach category $categories {
            if {[string index $category 0] eq "*"} {
                set default_p 1
                set category [string range $category 1 end]
            } else {
                set default_p 0
            }

            set category_id [content::keyword::get_keyword_id  -parent_id $category_type_id  -heading $category]

            if { $category_id eq "" } {
                set category_id [content::keyword::new  -parent_id $category_type_id  -heading $category]
            }

            if { $default_p } {
                bug_tracker::set_default_keyword  -package_id $package_id  -parent_id $category_type_id  -keyword_id $category_id
            }
        }
    }
    bug_tracker::get_keywords_flush -package_id $package_id
Generic XQL file:
packages/bug-tracker/tcl/bug-tracker-procs.xql

PostgreSQL XQL file:
packages/bug-tracker/tcl/bug-tracker-procs-postgresql.xql

Oracle XQL file:
packages/bug-tracker/tcl/bug-tracker-procs-oracle.xql

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