Index: openacs-4/packages/rss-support/rss-support.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/rss-support/rss-support.info,v diff -u -r1.1 -r1.2 --- openacs-4/packages/rss-support/rss-support.info 4 Nov 2001 23:17:40 -0000 1.1 +++ openacs-4/packages/rss-support/rss-support.info 9 Nov 2001 04:27:00 -0000 1.2 @@ -32,13 +32,17 @@ + + + + - + 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 -r1.2 -r1.3 --- openacs-4/packages/rss-support/tcl/rss-generation-service-procs.tcl 8 Nov 2001 05:42:56 -0000 1.2 +++ openacs-4/packages/rss-support/tcl/rss-generation-service-procs.tcl 9 Nov 2001 04:27:01 -0000 1.3 @@ -26,12 +26,62 @@ append args "-$name \"$val\" " } set xml [apply rss_gen $args] - # TODO: write contents to file system + 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] + puts $fh $xml + close $fh + # TODO: update lastbuild for this subscr_id ns_log Notice "rssgen: created report" ns_log Notice "rssgen: $xml" } } } +ad_proc rss_assert_dir path { +
+    # Steps through path creating each new directory as needed.
+    # Accepts full path or relative path, but you probably want
+    # to specify the full path.
+    # Makes no attempt to catch errors.
+    
+} { + set running_path "" + foreach dir [split $path /] { + append running_path ${dir}/ + if ![file exists $running_path] { + ns_mkdir $running_path + } + } +} + +ad_proc rss_package_id {} { +
+    # Returns the package_id for rss if it is rss is mounted.
+    # Returns 0 otherwise.
+    
+} { + if ![db_0or1row get_package_id {select package_id from apm_packages where package_key = 'rss-support'}] { + return 0 + } else { + return $package_id + } +} + +ad_proc rss_package_url {} { +
+    # Returns the rss package url if it is mounted.
+    # Returns the empty string otherwise.
+    
+} { + set package_id [rss_package_id] + return [db_string rss_url {select site_node__url(node_id) from site_nodes where object_id = :package_id} -default ""] + +} + # TODO: run as a scheduled proc \ No newline at end of file