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):
%3 test_data_links_scan_links data_links_scan_links (test acs-tcl) application_data_link::scan_for_links application_data_link::scan_for_links test_data_links_scan_links->application_data_link::scan_for_links test_data_links_scan_links_with_tag data_links_scan_links_with_tag (test acs-tcl) test_data_links_scan_links_with_tag->application_data_link::scan_for_links test_data_links_update_links data_links_update_links (test acs-tcl) test_data_links_update_links->application_data_link::scan_for_links test_data_links_update_links_with_tag data_links_update_links_with_tag (test acs-tcl) test_data_links_update_links_with_tag->application_data_link::scan_for_links ad_url ad_url (public) application_data_link::scan_for_links->ad_url db_list db_list (public) application_data_link::scan_for_links->db_list application_data_link::update_links_from application_data_link::update_links_from (public) application_data_link::update_links_from->application_data_link::scan_for_links

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 $refs
XQL 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

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