Index: openacs-4/packages/rss-support/tcl/rss-generation-service-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/rss-support/tcl/rss-generation-service-procs.tcl,v diff -u -N -r1.6 -r1.7 --- openacs-4/packages/rss-support/tcl/rss-generation-service-procs.tcl 30 Nov 2001 05:56:37 -0000 1.6 +++ openacs-4/packages/rss-support/tcl/rss-generation-service-procs.tcl 4 Dec 2001 04:57:20 -0000 1.7 @@ -61,13 +61,11 @@ } } set xml [apply rss_gen $args] - set report_dir [ns_info pageroot]/[ad_parameter -package_id [rss_package_id] RssGenOutputDirectory rss-support rss]/$impl_name/${summary_context_id} - # Create directory if needed. - rss_assert_dir $report_dir - # Write report. - set fh [open $report_dir/rss.xml w] + set report_file [rss_gen_report_file -summary_context_id $summary_context_id -impl_name $impl_name -assert -url] + + set fh [open $report_file w] puts $fh $xml close $fh @@ -136,4 +134,89 @@ ns_log Notice "rss_gen_bind: error binding impl $impl_id for contract $contract_id: $errMsg" } } +} + +ad_proc -private rss_gen_report_dir { + -summary_context_id + -impl_name + -subscr_id + {-assert:boolean f} +} { + Return a directory path, relative to the pageroot, for the rss + subscription with subscr_id or impl_name + summary_context_id + provided. +} { + if {!([info exists summary_context_id] && \ + [info exists impl_name])} { + if ![info exists subscr_id] { + error "rss_gen_report_dir needs either subscr_id or impl_id+summary_context_id" + } else { + db_1row subscr_context_and_impl { + select s.summary_context_id, + i.impl_name + from rss_gen_subscrs s, + acs_sc_impls i + where i.impl_id = s.impl_id + and s.subscr_id = :subscr_id + } + } + } + + set report_dir /[ad_parameter -package_id [rss_package_id] RssGenOutputDirectory rss-support rss]/$impl_name/${summary_context_id} + + if $assert_p { + rss_assert_dir $report_dir + } + + return $report_dir +} + +ad_proc -private rss_gen_report_file { + -summary_context_id + -impl_name + -subscr_id + {-assert:boolean f} + {-url:boolean t} +} { + Return a file path for the rss subscription with subscr_id + or impl_name + summary_context_id provided. + If the -assert flag is set, the parent directory is created if + it doesn't exist (default: false). + If the -url flag is set, return a url (default: true); otherwise + return a Unix file path. +} { + if {!([info exists summary_context_id] && \ + [info exists impl_name])} { + if ![info exists subscr_id] { + error "rss_gen_report_file needs either subscr_id or impl_id+summary_context_id" + } else { + db_1row subscr_context_and_impl { + select s.summary_context_id, + i.impl_name + from rss_gen_subscrs s, + acs_sc_impls i + where i.impl_id = s.impl_id + and s.subscr_id = :subscr_id + } + } + } + + if $assert_p { + set report_dir [rss_gen_report_dir \ + -summary_context_id $summary_context_id \ + -impl_name $impl_name \ + -assert] + } else { + set report_dir [rss_gen_report_dir \ + -summary_context_id $summary_context_id \ + -impl_name $impl_name] + } + + set report_url $report_dir/rss.xml + + if $url_p { + return $report_url + } else { + return [ns_url2file $report_url] + } } \ No newline at end of file Index: openacs-4/packages/rss-support/www/delete.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/rss-support/www/delete.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/rss-support/www/delete.adp 4 Dec 2001 04:57:20 -0000 1.1 @@ -0,0 +1,22 @@ + +Delete a Subcription + +

Delete Subscription

+@context_bar@ +
+ +
+Channel: @channel_title@ +@channel_title@ +
+ + + +Delete subscription
+Delete report +
+

+ + +

+
Index: openacs-4/packages/rss-support/www/delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/rss-support/www/delete.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/rss-support/www/delete.tcl 4 Dec 2001 04:57:20 -0000 1.1 @@ -0,0 +1,27 @@ +ad_page_contract { + Confirm deletion of a subscription. +} { + subscr_id:notnull,naturalnum + return_url:notnull +} + +ad_require_permission $subscr_id admin + +db_1row subscr_info { + select channel_title, + channel_link + from rss_gen_subscrs + where subscr_id = :subscr_id +} + +if [string equal $channel_title ""] { + set channel_title "Summary Context $summary_context_id" +} + +set context_bar [ad_context_bar Delete] + +if [file exists [rss_gen_report_file -subscr_id $subscr_id]] { + set offer_file 1 +} else { + set offer_file 0 +} \ No newline at end of file Index: openacs-4/packages/rss-support/www/subscr-ae.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/rss-support/www/subscr-ae.tcl,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/rss-support/www/subscr-ae.tcl 30 Nov 2001 05:56:37 -0000 1.3 +++ openacs-4/packages/rss-support/www/subscr-ae.tcl 4 Dec 2001 04:57:20 -0000 1.4 @@ -94,5 +94,5 @@ return_url \ meta] -set context_bar [ad_context_bar] +set context_bar [ad_context_bar Add/Edit] Index: openacs-4/packages/rss-support/www/admin/subscrs.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/rss-support/www/admin/subscrs.adp,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/rss-support/www/admin/subscrs.adp 30 Nov 2001 05:56:37 -0000 1.2 +++ openacs-4/packages/rss-support/www/admin/subscrs.adp 4 Dec 2001 04:57:20 -0000 1.3 @@ -18,10 +18,11 @@ @subscrs.channel_title@@subscrs.channel_title@ @subscrs.timeout@s @subscrs.lastbuild@ - @subscrs.last_ttb@ + @subscrs.last_ttb@ seconds @subscrs.creator@ edit | - run | delete + run | + delete Index: openacs-4/packages/rss-support/www/admin/subscrs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/rss-support/www/admin/subscrs.tcl,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/rss-support/www/admin/subscrs.tcl 30 Nov 2001 05:56:37 -0000 1.2 +++ openacs-4/packages/rss-support/www/admin/subscrs.tcl 4 Dec 2001 04:57:20 -0000 1.3 @@ -9,6 +9,7 @@ from rss_gen_subscrs s, acs_objects o where o.object_id = s.subscr_id + order by s.last_ttb desc } { if [string equal $channel_title ""] { set channel_title "Subscription #$subscr_id"