news_do_notification (public)
news_do_notification news_package_id news_id
Defined in packages/news/tcl/news-procs.tcl
Sends notifications for specified news item.
- Parameters:
- news_package_id (required)
- news_id (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: set system_url [parameter::get_from_package_key -package_key acs-kernel -parameter SystemURL] set package_url [apm_package_url_from_id $news_package_id] set node_id [ad_conn node_id] set instance_name [application_group::closest_ancestor_element -include_self -node_id $node_id -element "instance_name"] # get the title and teaser for latest news item for the given package id if { [db_0or1row get_news { select item_id, publish_date, publish_title as title, publish_lead as lead, publish_body, publish_format from news_items_live_or_submitted where news_id = :news_id }] } { set item_url ${system_url}${package_url}item?item_id=$item_id set new_content "$title\n\n$lead\n\n[ad_html_text_convert -from $publish_format -to text/plain -- $publish_body]" set html_content [ad_html_text_convert -from $publish_format -to text/html -- $publish_body] append new_content "\n\n[string repeat - 70]" append new_content "\n\n${item_url} \n\n" append html_content "<br><br><hr>" [ad_html_text_convert "\n ${item_url}"] "<br><br>" } # Notifies the users that requested notification for the specific news item notification::new -type_id [notification::type::get_type_id -short_name one_news_item_notif] -object_id $news_package_id -notif_subject "\[$instance_name\] #news.Latest_News#" -notif_text $new_content -notif_html $html_content -notif_date $publish_dateGeneric XQL file: packages/news/tcl/news-procs.xql
PostgreSQL XQL file: packages/news/tcl/news-procs-postgresql.xql
Oracle XQL file: packages/news/tcl/news-procs-oracle.xql