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 -N -r1.13.2.3 -r1.13.2.4
--- openacs-4/packages/rss-support/rss-support.info 12 Jan 2005 07:17:40 -0000 1.13.2.3
+++ openacs-4/packages/rss-support/rss-support.info 23 Jan 2005 21:05:45 -0000 1.13.2.4
@@ -8,7 +8,7 @@
t
rss-support
-
+
Dave Bauer
Jerry Asher
Andrew Grumet
@@ -32,7 +32,7 @@
</ul>
-
+
Index: openacs-4/packages/rss-support/sql/postgresql/rss-generation-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/rss-support/sql/postgresql/rss-generation-create.sql,v
diff -u -N -r1.10.4.1 -r1.10.4.2
--- openacs-4/packages/rss-support/sql/postgresql/rss-generation-create.sql 13 Dec 2004 16:13:24 -0000 1.10.4.1
+++ openacs-4/packages/rss-support/sql/postgresql/rss-generation-create.sql 23 Jan 2005 21:05:45 -0000 1.10.4.2
@@ -164,6 +164,7 @@
Used for display purposes.
';
+select define_function_args ('rss_gen_subscr__new','subscr_id,impl_id,summary_context_id,timeout,lastbuild,object_type,creation_date;now,creation_user,creation_ip,context_id');
create function rss_gen_subscr__new (
integer, -- subscr_id
integer, -- impl_id
@@ -222,10 +223,11 @@
return ''RSS Generation Subscription #'' || p_subscr_id;
end;' language 'plpgsql';
-create function rss_gen_subscr__delete (integer)
+select define_function_args('rss_gen_subscr__del','subscr_id');
+create or replace function rss_gen_subscr__del (integer)
returns integer as '
declare
- p_subscr_id alias for $1;
+ p_subscr_id alias for $1;
begin
delete from acs_permissions
where object_id = p_subscr_id;
@@ -239,3 +241,11 @@
return 0;
end;' language 'plpgsql';
+
+create or replace function rss_gen_subscr__delete (integer)
+returns integer as '
+declare
+ p_subscr_id alias for $1;
+begin
+ return rss_gen_subscr__del (p_subscr_id);
+end;' language 'plpgsql';
Index: openacs-4/packages/rss-support/sql/postgresql/rss-generation-drop.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/rss-support/sql/postgresql/rss-generation-drop.sql,v
diff -u -N -r1.4 -r1.4.4.1
--- openacs-4/packages/rss-support/sql/postgresql/rss-generation-drop.sql 17 May 2003 11:20:27 -0000 1.4
+++ openacs-4/packages/rss-support/sql/postgresql/rss-generation-drop.sql 23 Jan 2005 21:05:45 -0000 1.4.4.1
@@ -18,4 +18,5 @@
drop table rss_gen_subscrs;
drop function rss_gen_subscr__new (integer,integer,varchar,integer,timestamptz,varchar,timestamptz,integer,varchar,integer);
drop function rss_gen_subscr__name (integer);
+drop function rss_gen_subscr__del (integer);
drop function rss_gen_subscr__delete (integer);
Index: openacs-4/packages/rss-support/sql/postgresql/upgrade/upgrade-0.3d4-0.3d5.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/rss-support/sql/postgresql/upgrade/upgrade-0.3d4-0.3d5.sql,v
diff -u -N
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/rss-support/sql/postgresql/upgrade/upgrade-0.3d4-0.3d5.sql 23 Jan 2005 21:05:45 -0000 1.1.2.1
@@ -0,0 +1,35 @@
+--
+--
+--
+-- @author Dave Bauer (dave@thedesignexperience.org)
+-- @creation-date 2005-01-23
+-- @arch-tag: 2abf85db-45a1-4444-856d-683a01be7937
+-- @cvs-id $Id: upgrade-0.3d4-0.3d5.sql,v 1.1.2.1 2005/01/23 21:05:45 daveb Exp $
+--
+
+select define_function_args('rss_gen_subscr__del','subscr_id');
+create or replace function rss_gen_subscr__del (integer)
+returns integer as '
+declare
+ p_subscr_id alias for $1;
+begin
+ delete from acs_permissions
+ where object_id = p_subscr_id;
+
+ delete from rss_gen_subscrs
+ where subscr_id = p_subscr_id;
+
+ raise NOTICE ''Deleting subscription...'';
+ PERFORM acs_object__delete(p_subscr_id);
+
+ return 0;
+
+end;' language 'plpgsql';
+
+create or replace function rss_gen_subscr__delete (integer)
+returns integer as '
+declare
+ p_subscr_id alias for $1;
+begin
+ return rss_gen_subscr__del (p_subscr_id);
+end;' language 'plpgsql';
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.14 -r1.14.4.1
--- openacs-4/packages/rss-support/tcl/rss-generation-service-procs.tcl 1 Nov 2003 08:45:39 -0000 1.14
+++ openacs-4/packages/rss-support/tcl/rss-generation-service-procs.tcl 23 Jan 2005 21:05:45 -0000 1.14.4.1
@@ -45,7 +45,12 @@
ns_log Error "Empty datasource returned from $impl_name for context $summary_context_id in rss_gen_report. Probably because the implementation hasn't been bound."
return
}
-
+ ns_log notice "
+DB --------------------------------------------------------------------------------
+DB DAVE debugging procedure rss_gen_report
+DB --------------------------------------------------------------------------------
+DB datasource = '${datasource}'
+DB --------------------------------------------------------------------------------"
set args ""
foreach {name val} $datasource {
regsub -all {[\]\[\{\}""\\$]} $val {\\&} val
Index: openacs-4/packages/rss-support/tcl/rss-support-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/rss-support/tcl/rss-support-procs.tcl,v
diff -u -N -r1.1.2.1 -r1.1.2.2
--- openacs-4/packages/rss-support/tcl/rss-support-procs.tcl 23 Jan 2005 19:51:43 -0000 1.1.2.1
+++ openacs-4/packages/rss-support/tcl/rss-support-procs.tcl 23 Jan 2005 21:05:45 -0000 1.1.2.2
@@ -67,3 +67,64 @@
-var_list $var_list \
rss_gen_subscr new]
}
+
+ad_proc -public rss_support::del_subscription {
+ -summary_context_id
+ -impl_name
+ -owner
+} {
+
+
+
+ @author Dave Bauer (dave@thedesignexperience.org)
+ @creation-date 2005-01-23
+
+ @param summary_context_id summary context id to delete
+
+ @param impl_name implemenation name to delete
+
+ @param owner owner package of implementation
+ @return
+
+ @error
+} {
+ set impl_id [acs_sc::impl::get_id \
+ -name $impl_name \
+ -contract RssGenerationSubscriber \
+ -owner $owner]
+ set subscr_id [db_string get_subscr_id ""]
+ set report_dir [rss_gen_report_dir -subscr_id $subscr_id]
+ # remove generated RSS reports for this subscription
+ file delete -force $report_dir
+ ns_log notice "
+DB --------------------------------------------------------------------------------
+DB DAVE debugging procedure rss_support::del_subscription
+DB --------------------------------------------------------------------------------
+DB impl_name = '${impl_name}'
+DB impl_id = '${impl_id}'
+DB subscr_id = '${subscr_id}'
+
+DB --------------------------------------------------------------------------------"
+ package_exec_plsql \
+ -var_list [list [list subscr_id $subscr_id]] \
+ rss_gen_subscr del
+}
+
+ad_proc -public rss_support::subscription_exists {
+ -summary_context_id
+ -impl_name
+} {
+
+ Check if a subscription exists
+
+ @author Dave Bauer (dave@thedesignexperience.org)
+ @creation-date 2005-01-23
+
+ @param summary_context_id summary context id to check
+
+ @return
+
+ @error
+} {
+ return [db_string subscription_exists "" -default 0]
+}