Index: openacs-4/packages/news-aggregator/tcl/source-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news-aggregator/tcl/source-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/news-aggregator/tcl/source-procs.tcl 20 Mar 2004 13:30:17 -0000 1.3 +++ openacs-4/packages/news-aggregator/tcl/source-procs.tcl 20 Mar 2004 14:51:52 -0000 1.4 @@ -14,21 +14,28 @@ -user_id:required -package_id:required {-aggregator_id ""} + -array:boolean } { @author Simon Carstensen - Parse feed_url for link, title, and description. Then insert the source if it does not excist already. + Parse feed_url for link, title, and description. Then insert the source if it does not excist already. Subscribe the specified aggregator to the source. + + @param array Return more into in an array } { - set source_id [db_string source {} -default ""] - - if { [exists_and_not_null source_id] } { + if { [db_0or1row source {}] } { if { [exists_and_not_null aggregator_id] } { news_aggregator::subscription::new \ -aggregator_id $aggregator_id \ -source_id $source_id - return $source_id + if { $array_p } { + set info(source_id) $source_id + set info(title) $source_title + return [array get info] + } else { + return $source_id + } } return 0 } @@ -41,6 +48,7 @@ array set channel $result(channel) set title [string_truncate -len 500 -- $channel(title)] + set channel_title $title set link [string_truncate -len 500 -- $channel(link)] set description [string_truncate -len 500 -- $channel(description)] @@ -70,7 +78,13 @@ set content_encoded $item(content_encoded) } - return $source_id + if { $array_p } { + set info(source_id) $source_id + set info(title) $channel_title + return [array get info] + } else { + return $source_id + } } Index: openacs-4/packages/news-aggregator/tcl/source-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news-aggregator/tcl/Attic/source-procs.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/news-aggregator/tcl/source-procs.xql 20 Mar 2004 14:06:45 -0000 1.2 +++ openacs-4/packages/news-aggregator/tcl/source-procs.xql 20 Mar 2004 14:51:52 -0000 1.3 @@ -23,7 +23,7 @@ - select source_id + select source_id, title as source_title from na_sources where feed_url = :feed_url Index: openacs-4/packages/news-aggregator/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news-aggregator/www/index.adp,v diff -u -r1.6 -r1.7 --- openacs-4/packages/news-aggregator/www/index.adp 20 Mar 2004 13:21:01 -0000 1.6 +++ openacs-4/packages/news-aggregator/www/index.adp 20 Mar 2004 14:51:53 -0000 1.7 @@ -6,6 +6,7 @@

» Manage Subscriptions
» Manage This Aggregator
+ » Create New Aggregator

@aggregator_description@ Index: openacs-4/packages/news-aggregator/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news-aggregator/www/index.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/news-aggregator/www/index.tcl 20 Mar 2004 11:12:29 -0000 1.3 +++ openacs-4/packages/news-aggregator/www/index.tcl 20 Mar 2004 14:51:53 -0000 1.4 @@ -63,6 +63,8 @@ set return_url [ad_conn url] set aggregator_url [export_vars -base aggregator { return_url aggregator_id }] +set create_url "${package_url}/aggregator" + set limit [ad_parameter "number_of_items_shown"] set sql_limit [expr 7*$limit] Index: openacs-4/packages/news-aggregator/www/subscriptions.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news-aggregator/www/subscriptions.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/news-aggregator/www/subscriptions.tcl 20 Mar 2004 11:12:29 -0000 1.3 +++ openacs-4/packages/news-aggregator/www/subscriptions.tcl 20 Mar 2004 14:51:53 -0000 1.4 @@ -121,9 +121,6 @@ set package_url [ad_conn package_url] db_multirow -extend {xml_graphics_url} sources sources {} { - if { [exists_and_not_null new_source_id] && $source_id == $new_source_id } { - set new_source_title $title - } set xml_graphics_url "${package_url}graphics/xml.gif" } @@ -143,13 +140,13 @@ { You must specify a URL } } } -new_data { - set new_source_id [news_aggregator::source::new \ + array set channel [news_aggregator::source::new \ -feed_url $feed_url \ -aggregator_id $aggregator_id \ -user_id $user_id \ - -package_id $package_id] - - - ad_returnredirect [export_vars -base subscriptions {new_source_id}] + -package_id $package_id \ + -array] + set title $channel(title) + ad_returnredirect -message "You have been subscribed to $title." subscriptions ad_script_abort }