category_tree::update (public)

 category_tree::update -tree_id tree_id -name name \
    [ -description description ] [ -site_wide_p site_wide_p ] \
    [ -locale locale ] [ -user_id user_id ] \
    [ -modifying_ip modifying_ip ]

Defined in packages/categories/tcl/category-trees-procs.tcl

Updates / inserts a category tree translation.

Switches:
-tree_id (required)
-name (required)
-description (optional)
-site_wide_p (optional, defaults to "f")
-locale (optional)
-user_id (optional)
-modifying_ip (optional)
Options:
-tree_id
tree_id of the category tree to be updated.
-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.
-modifying_ip
ip-address of the user that updated the category tree. [ad_conn peeraddr] used by default.
Author:
Timo Hentschel <timo@timohentschel.de>

Partial Call Graph (max 5 caller/called nodes):
%3 test_category_crud category_crud (test categories) category_tree::update category_tree::update test_category_crud->category_tree::update test_category_tree_procs category_tree_procs (test categories) test_category_tree_procs->category_tree::update ad_conn ad_conn (public) category_tree::update->ad_conn category_tree::flush_translation_cache category_tree::flush_translation_cache (public) category_tree::update->category_tree::flush_translation_cache db_0or1row db_0or1row (public) category_tree::update->db_0or1row db_exec_plsql db_exec_plsql (public) category_tree::update->db_exec_plsql db_transaction db_transaction (public) category_tree::update->db_transaction category_tree::xml::import category_tree::xml::import (public) category_tree::xml::import->category_tree::update packages/categories/lib/tree-form.tcl packages/categories/ lib/tree-form.tcl packages/categories/lib/tree-form.tcl->category_tree::update

Testcases:
category_crud, category_tree_procs
Source code:
        if {$user_id eq ""} {
            set user_id [ad_conn user_id]
        }
        if {$modifying_ip eq ""} {
            set modifying_ip [ad_conn peeraddr]
        }
        if {$locale eq ""} {
            set locale [ad_conn locale]
        }
        db_transaction {
            if {![db_0or1row check_tree_existence {
        select 1
        from category_tree_translations
        where tree_id = :tree_id
        and locale = :locale
            }]} {
                db_exec_plsql insert_tree_translation ""
            } else {
                db_exec_plsql update_tree_translation ""
            }
        }
        category_tree::flush_translation_cache $tree_id
XQL Not present:
Generic
PostgreSQL XQL file:
<fullquery name="category_tree::update.insert_tree_translation">
    <querytext>
		    select category_tree__new_translation (
						   :tree_id,
						   :locale,
						   :name,
						   :description,
                                                   current_timestamp,
						   :user_id,
						   :modifying_ip
						   )
      </querytext>
</fullquery>

<fullquery name="category_tree::update.update_tree_translation">
    <querytext>
		    select category_tree__edit (
					:tree_id,
					:locale,
					:name,
					:description,
                                        :site_wide_p,
                                        current_timestamp,
					:user_id,
					:modifying_ip
					)
      </querytext>
</fullquery>
packages/categories/tcl/category-trees-procs-postgresql.xql

Oracle XQL file:
<fullquery name="category_tree::update.insert_tree_translation">
    <querytext>
      
		    begin
		    category_tree.new_translation (
						   tree_id        => :tree_id,
						   tree_name      => :name,
						   description    => :description,
						   locale         => :locale,
						   modifying_user => :user_id,
						   modifying_ip   => :modifying_ip
						   );
		    end;
		
      </querytext>
</fullquery>

<fullquery name="category_tree::update.update_tree_translation">
    <querytext>
      
		    begin
		    category_tree.edit (
					tree_id        => :tree_id,
					tree_name      => :name,
					description    => :description,
					locale         => :locale,
					modifying_user => :user_id,
					modifying_ip   => :modifying_ip
					);
		    end;
		
      </querytext>
</fullquery>
packages/categories/tcl/category-trees-procs-oracle.xql

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