application_data_link::update_links_from (public)
application_data_link::update_links_from [ -object_id object_id ] \ [ -text text ] [ -link_object_ids link_object_ids ] \ [ -relation_tag relation_tag ]
Defined in packages/acs-tcl/tcl/application-data-link-procs.tcl
Update the references to this object in the database, optionally update links using the given relation_tag.
- Switches:
- -object_id (optional)
- Object_id to update
- -text (optional)
- Text to scan for references
- -link_object_ids (optional)
- List of object ids to update the links to. Links not in this list will be deleted, and any in this list that are not in the database will be added.
- -relation_tag (optional)
- Relationship identifier
- Returns:
- List of updated linked object_ids
- Author:
- Dave Bauer <dave@solutiongrove.com>
- Created:
- 2006-08-31
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- data_links_update_links, data_links_update_links_with_tag
Source code: set old_links [application_data_link::get_links_from -object_id $object_id -relation_tag $relation_tag] if {![llength $link_object_ids]} { set link_object_ids [application_data_link::scan_for_links -text $text] } set delete_ids [list] foreach old_link $old_links { if {$old_link ni $link_object_ids} { lappend delete_ids $old_link } } application_data_link::delete_from_list -object_id $object_id -link_object_id_list $delete_ids -relation_tag $relation_tag foreach new_link $link_object_ids { if {![application_data_link::link_exists -from_object_id $object_id -to_object_id $new_link -relation_tag $relation_tag] } { application_data_link::new_from -object_id $object_id -to_object_id $new_link -relation_tag $relation_tag } }XQL Not present: PostgreSQL, Oracle Generic XQL file: packages/acs-tcl/tcl/application-data-link-procs.xql