category_tree::add (public)
category_tree::add [ -tree_id tree_id ] -name name \ [ -description description ] [ -site_wide_p site_wide_p ] \ [ -locale locale ] [ -user_id user_id ] \ [ -creation_ip creation_ip ] [ -context_id context_id ]
Defined in packages/categories/tcl/category-trees-procs.tcl
Insert a new category tree. The same translation will be added in the default language if it's in a different language.
- Switches:
- Options:
- -tree_id (optional)
- -name (required)
- -description (optional)
- -site_wide_p (optional, defaults to
"f"
)- -locale (optional)
- -user_id (optional)
- -creation_ip (optional)
- -context_id (optional)
- -tree_id
- tree_id of the category tree to be inserted.
- -locale
- locale of the language. [ad_conn locale] used by default.
- -name
- tree name.
- -description
- description of the category tree.
- -user_id
- user that adds the category tree. [ad_conn user_id] used by default.
- -creation_ip
- ip-address of the user that adds the category tree. [ad_conn peeraddr] used by default.
- -context_id
- context_id of the category tree. [ad_conn package_id] used by default.
- Returns:
- tree_id
- Author:
- Timo Hentschel <timo@timohentschel.de>
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- category_synonyms, category_link, category_crud, category_get_procs, category_tree_procs
Source code: if {$user_id eq ""} { set user_id [ad_conn user_id] } if {$creation_ip eq ""} { set creation_ip [ad_conn peeraddr] } if {$locale eq ""} { set locale [ad_conn locale] } if {$context_id eq ""} { set context_id [ad_conn package_id] } db_transaction { set tree_id [db_exec_plsql insert_tree ""] set default_locale [parameter::get -parameter DefaultLocale -default en_US] if {$locale != $default_locale} { db_exec_plsql insert_default_tree "" } } category_tree::flush_translation_cache $tree_id return $tree_idXQL Not present: Generic PostgreSQL XQL file: <fullquery name="category_tree::add.insert_tree"> <querytext> select category_tree__new ( :tree_id, :locale, :name, :description, :site_wide_p, current_timestamp, :user_id, :creation_ip, :context_id ) </querytext> </fullquery> <fullquery name="category_tree::add.insert_default_tree"> <querytext> select category_tree__new_translation ( :tree_id, :default_locale, :name, :description, current_timestamp, :user_id, :creation_ip ) </querytext> </fullquery>packages/categories/tcl/category-trees-procs-postgresql.xql
Oracle XQL file: <fullquery name="category_tree::add.insert_tree"> <querytext> begin :1 := category_tree.new ( tree_id => :tree_id, tree_name => :name, description => :description, locale => :locale, creation_user => :user_id, creation_ip => :creation_ip, context_id => :context_id ); end; </querytext> </fullquery> <fullquery name="category_tree::add.insert_default_tree"> <querytext> begin category_tree.new_translation ( tree_id => :tree_id, tree_name => :name, description => :description, locale => :default_locale, modifying_user => :user_id, modifying_ip => :creation_ip ); end; </querytext> </fullquery>packages/categories/tcl/category-trees-procs-oracle.xql