content::item::delete (public)

 content::item::delete -item_id item_id

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

Switches:
-item_id (required)
Author:
Dave Bauer <dave@thedesignexperience.org>
Created:
2004-05-28 Delete a content item from the database. If the content item to delete has children content items referencing its parent via acs_objects.context_id then this proc will fail.

Partial Call Graph (max 5 caller/called nodes):
%3 test_content_image content_image (test acs-content-repository) content::item::delete content::item::delete test_content_image->content::item::delete test_content_item content_item (test acs-content-repository) test_content_item->content::item::delete test_content_revision content_revision (test acs-content-repository) test_content_revision->content::item::delete content::revision::cleanup content::revision::cleanup (private) content::item::delete->content::revision::cleanup content::revision::collect_cleanup_data content::revision::collect_cleanup_data (private) content::item::delete->content::revision::collect_cleanup_data db_1row db_1row (public) content::item::delete->db_1row db_transaction db_transaction (public) content::item::delete->db_transaction package_exec_plsql package_exec_plsql (public) content::item::delete->package_exec_plsql acs_user::erase_portrait acs_user::erase_portrait (public) acs_user::erase_portrait->content::item::delete bug_tracker::bug::delete bug_tracker::bug::delete (public) bug_tracker::bug::delete->content::item::delete content::extlink::delete content::extlink::delete (public) content::extlink::delete->content::item::delete general_comments_delete_messages general_comments_delete_messages (public) general_comments_delete_messages->content::item::delete packages/bug-tracker/www/related-file-delete.tcl packages/bug-tracker/ www/related-file-delete.tcl packages/bug-tracker/www/related-file-delete.tcl->content::item::delete

Testcases:
content_image, content_item, content_revision
Source code:
    set result 0
    db_1row get_storage_type {select storage_type, storage_area_key from cr_items where item_id = :item_id}

    set cleanup_data [::content::revision::collect_cleanup_data  -item_id $item_id  -storage_type $storage_type]
    db_transaction {
        set result [package_exec_plsql  -var_list [list [list item_id $item_id]]  content_item del]
        #
        # In case, everything goes well in the call above, we perform
        # the cleanup.
        #
        ::content::revision::cleanup  -storage_area_key $storage_area_key  -storage_type $storage_type  -data $cleanup_data
    }
    return $result
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: