application_data_link::scan_for_links (public)
application_data_link::scan_for_links [ -text text ]
Defined in packages/acs-tcl/tcl/application-data-link-procs.tcl
Search for object references within text Supports /o/ /file/ /image/ object URL formats
- Switches:
- -text (optional)
- Text to scan for object links
- Returns:
- List of linked object_ids
- Author:
- Dave Bauer <dave@solutiongrove.com>
- Created:
- 2006-08-31
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- data_links_scan_links, data_links_update_links, data_links_scan_links_with_tag, data_links_update_links_with_tag
Source code: set refs [list] set http_url [string trimright [ad_url] /]/ set https_url [string map {http https} $http_url] set re "(?:\")(?:$http_url|$https_url|/)(?:o|image|file)/(\\d+)" set ref_data [regexp -inline -all $re $text] foreach {discard ref} $ref_data { lappend refs $ref } if {[llength $refs]} { set refs [db_list confirm_object_ids {}] } return $refsXQL Not present: PostgreSQL, Oracle Generic XQL file: <fullquery name="application_data_link::scan_for_links.confirm_object_ids"> <querytext> select object_id from acs_objects where object_id in ([ns_dbquotelist $refs]) </querytext> </fullquery>packages/acs-tcl/tcl/application-data-link-procs.xql