content::item::update (public)

 content::item::update -item_id item_id -attributes attributes

Defined in packages/acs-content-repository/tcl/content-item-procs.tcl

Update standard non-versioned content item attributes (cr_items) Valid attributes: name parent_id latest_revision live_revision locale publish_status

Switches:
-item_id (required)
item to update
-attributes (required)
A list of pairs of additional attributes and their values to get. Each pair is a list of two elements: key => value
Returns:
Error:
Author:
Dave Bauer <dave@thedesignexperience.org>
Created:
2004-06-04

Partial Call Graph (max 5 caller/called nodes):
%3 test_content_item content_item (test acs-content-repository) content::item::update content::item::update test_content_item->content::item::update test_cr_item_search_triggers cr_item_search_triggers (test acs-content-repository) test_cr_item_search_triggers->content::item::update db_dml db_dml (public) content::item::update->db_dml content::folder::update content::folder::update (public) content::folder::update->content::item::update content::item::unpublish content::item::unpublish (public) content::item::unpublish->content::item::update

Testcases:
content_item, cr_item_search_triggers
Source code:
    # do not allow update of item_id, storage_location, storage_type,
    # content_type, or tree_sortkey

    set valid_attributes [list name parent_id latest_revision live_revision locale publish_status]

    set update_text ""

    foreach {attribute_list} $attributes {
        lassign $attribute_list attribute value
        if {$attribute in $valid_attributes}  {

            # create local variable to use for binding

            set $attribute $value
            if {$update_text ne ""} {
                append update_text ","
            }
            append update_text ${attribute} = :${attribute} "
        }
    }
    if {$update_text ne ""} {

    # we have valid attributes, update them

    set query_text "update cr_items set ${update_text} where item_id=:item_id"
    db_dml item_update $query_text
    }
Generic XQL file:
packages/acs-content-repository/tcl/content-item-procs.xql

PostgreSQL XQL file:
packages/acs-content-repository/tcl/content-item-procs-postgresql.xql

Oracle XQL file:
packages/acs-content-repository/tcl/content-item-procs-oracle.xql

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