Index: openacs-4/packages/news-aggregator/tcl/aggregator-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news-aggregator/tcl/aggregator-procs.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/news-aggregator/tcl/aggregator-procs.tcl 17 Jul 2018 13:40:23 -0000 1.8 +++ openacs-4/packages/news-aggregator/tcl/aggregator-procs.tcl 18 Jul 2018 09:18:50 -0000 1.9 @@ -1,6 +1,6 @@ ad_library { Procs to manage aggregators. - + @author Simon Carstensen (simon@bcuni.net) @author Guan Yang (guan@unicast.org) @creation-date 2003-06-28 @@ -14,7 +14,7 @@ } { Returns a Tcl array-list with some aggregator information: aggregator_name, aggregator_description and public_p. - + @author Guan Yang (guan@unicast.org) @creation-date 2003-11-10 @return Tcl array-list with the information, or empty @@ -23,11 +23,11 @@ if { ![db_0or1row aggregator_info ""] } { return "" } - + set info(aggregator_name) $aggregator_name set info(aggregator_description) $aggregator_description set info(public_p) $public_p - + return [array get info] } @@ -41,12 +41,12 @@ would be displayed in a public aggregator. The format is specific to the news aggregator. It is intended to be processed with an XSLT stylesheet -- that is why we don't return the raw XML string. - + @param stylesheet An URI for a stylesheet that will be inserted into the document as the xml-stylesheet processing instruction. @param stylesheet_type MIME type for the stylesheet. - + @author Guan Yang (guan@unicast.org) @creation-date 2003-07-10 @return tDOM document node @@ -55,33 +55,33 @@ -aggregator_id $aggregator_id \ -package_id $package_id \ -purge_p 0] - + set doc [dom createDocument "aggregator"] - + set doc_node [$doc documentElement] $doc_node setAttribute "version" "0.9" - + # Create the xml processing instruction set pi [$doc createProcessingInstruction "xml" {version="1.0"}] set root [$doc_node selectNode /] $root insertBefore $pi $doc_node - + # If applicable, create the xml-stylesheet processing instruction if { [info exists stylesheet] && [info exists stylesheet_type] } { set pi [$doc createProcessingInstruction "xml-stylesheet" "href=\"$stylesheet\" type=\"$stylesheet_type\""] $root insertBefore $pi $doc_node } - + # Create a generator comment set comment [$doc createComment " Generated by the [ad_system_name] news aggregator. [ad_url] "] $root insertBefore $comment $doc_node - + set head_node [$doc createElement head] $doc_node appendChild $head_node - + array set info [news_aggregator::aggregator::aggregator_info \ -aggregator_id $aggregator_id] - + set header_fields [list \ [list aggregator_name name] \ [list aggregator_description description]] @@ -91,10 +91,10 @@ $node appendChild $text_node $head_node appendChild $node } - + set body_node [$doc createElement "body"] $doc_node appendChild $body_node - + set previous_source_id 0 db_foreach items_sql $items_query { if { $source_id != $previous_source_id } { @@ -104,35 +104,35 @@ description $description $body_node appendChild $source_node } - + set item_node [$doc createElement item] - + set title_node [$doc createElement title] set text_node [$doc createTextNode $item_title] $title_node appendChild $text_node $item_node appendChild $title_node - + set link_node [$doc createElement link] set text_node [$doc createTextNode $item_link] $link_node appendChild $text_node $item_node appendChild $link_node - + if { $content_encoded ne "" } { set content $content_encoded } else { set content $item_description } - + set content_node [$doc createElement content] set text_node [$doc createCDATASection $content] $content_node appendChild $text_node $item_node appendChild $content_node - + $source_node appendChild $item_node - + set previous_source_id $source_id } - + set xml [$doc asXML] $doc delete return $xml @@ -152,10 +152,10 @@ } else { set items_purges "" } - + set limit [parameter::get -package_id $package_id -parameter "number_of_items_shown"] set sql_limit [expr {$limit_multiple*$limit}] - + set sql [db_map items] return $sql } @@ -371,7 +371,7 @@ } { db_foreach select_feeds {} { - + news_aggregator::subscription::new \ -aggregator_id $aggregator_id \ -source_id $source_id