content::folder::update (public)

 content::folder::update -folder_id folder_id -attributes attributes

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

Update standard cr_folder attributes, including the attributes for the folder cr_item

Switches:
-folder_id (required)
folder to update
-attributes (required)
A list of pairs of additional attributes and their values to set. Each pair is a list of lists of two elements: key => value Valid attributes are: label, description, name, package_id
Returns:
Error:
Author:
Dave Bauer <dave@thedesignexperience.org>
Created:
2004-06-04

Partial Call Graph (max 5 caller/called nodes):
%3 test_content_folder content_folder (test acs-content-repository) content::folder::update content::folder::update test_content_folder->content::folder::update content::item::update content::item::update (public) content::folder::update->content::item::update db_dml db_dml (public) content::folder::update->db_dml Class ::xo::db::CrFolder Class ::xo::db::CrFolder (public) Class ::xo::db::CrFolder->content::folder::update packages/file-storage/www/folder-edit.tcl packages/file-storage/ www/folder-edit.tcl packages/file-storage/www/folder-edit.tcl->content::folder::update xo::db::CrFolder instproc save xo::db::CrFolder instproc save (public) xo::db::CrFolder instproc save->content::folder::update

Testcases:
content_folder
Source code:
    set valid_attributes [list label description package_id]

    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_folders set ${update_text} where folder_id=:folder_id"
        db_dml item_update $query_text
    }

    # pass the rest of the attributes to content::item::update
    # we can just send the folder attributes because they don't overlap
    content::item::update  -item_id $folder_id  -attributes $attributes
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: