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 -r1.3 -r1.4 --- openacs-4/packages/rss-support/sql/postgresql/rss-generation-create.sql 5 Nov 2001 03:55:01 -0000 1.3 +++ openacs-4/packages/rss-support/sql/postgresql/rss-generation-create.sql 5 Nov 2001 04:13:17 -0000 1.4 @@ -72,6 +72,22 @@ ''f'' -- static_p ); + PERFORM acs_attribute__create_attribute ( + ''rss_gen_subscr'', -- object_type + ''LASTBUILD'', -- attribute_name + ''integer'', -- datatype + ''Last Build'', -- pretty_name + ''Last Builds'', -- pretty_plural + null, -- table_name + null, -- column_name + null, -- default_value + 1, -- min_n_values + 1, -- max_n_values + null, -- sort_order + ''type_specific'', -- storage + ''f'' -- static_p + ); + return 0; end;' language 'plpgsql'; @@ -95,7 +111,8 @@ not null, timeout integer constraint rss_gen_subscrs_timeout_nn - not null + not null, + lastbuild timestamp ); comment on table rss_gen_subscrs is ' @@ -124,18 +141,23 @@ The minimum number of seconds between summary builds. '; -create function rss_gen_subscr__new (integer,integer,varchar,integer,varchar,timestamp,integer,varchar,integer) +comment on column rss_gen_subscrs.lastbuild is ' + Accounting column for use by rss generation service. +'; + +create function rss_gen_subscr__new (integer,integer,varchar,integer,timestamp,varchar,timestamp,integer,varchar,integer) returns integer as ' declare p_subscr_id alias for $1; p_impl_id alias for $2; p_summary_context_id alias for $3; p_timeout alias for $4; - p_object_type alias for $5; -- default ''rss_gen_subscr'' - p_creation_date alias for $6; -- default now() - p_creation_user alias for $7; -- default null - p_creation_ip alias for $8; -- default null - p_context_id alias for $9; -- default null + p_lastbuild alias for $5; + p_object_type alias for $6; -- default ''rss_gen_subscr'' + p_creation_date alias for $7; -- default now() + p_creation_user alias for $8; -- default null + p_creation_ip alias for $9; -- default null + p_context_id alias for $10; -- default null v_subscr_id rss_gen_subscrs.subscr_id%TYPE; begin v_subscr_id := acs_object__new ( @@ -148,9 +170,9 @@ ); insert into rss_gen_subscrs - (subscr_id, impl_id, summary_context_id, timeout) + (subscr_id, impl_id, summary_context_id, timeout, lastbuild) values - (v_subscr_id, p_impl_id, p_summary_context_id, p_timeout); + (v_subscr_id, p_impl_id, p_summary_context_id, p_timeout, p_lastbuild); return v_subscr_id; 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 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/rss-support/tcl/rss-generation-service-procs.tcl 5 Nov 2001 04:13:17 -0000 1.1 @@ -0,0 +1,11 @@ +# + +# ad_proc rss_gen_service {} +# +# This scheduled proc does the following +# +# 1. loop through all subscriptions; for each subscription: +# 2. compare last time since last run against timeout +# 3. if timeout exceeded, query LastUpdated +# 4. if last updated > last run time, build report +# Index: openacs-4/packages/rss-support/www/doc/index.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/rss-support/www/doc/index.html,v diff -u -r1.2 -r1.3 --- openacs-4/packages/rss-support/www/doc/index.html 5 Nov 2001 02:53:33 -0000 1.2 +++ openacs-4/packages/rss-support/www/doc/index.html 5 Nov 2001 04:13:17 -0000 1.3 @@ -45,12 +45,12 @@
RssGenerationSubscriber
and consists of two operations.
Datasource(context_identifier)
returns a data
+Datasource(summary_context_id)
returns a data
structure that contains all required metadata fields plus
configuration information such as the RSS version to be used (0.91 or
1.00 are supported at present). This data structure contains
everything needed to run rss_gen
.
-LastUpdated(context_identifier)
returns a timestamp
+LastUpdated(summary_context_id)
returns a timestamp
that is used to determine if the live summary is out of date.
-Implementation suggestions:
+RSS files.All summaries are static files. They are served
+from a static directory under the webroot specific by the
+RssGenOutputDirectory, which defaults to rss
. The full
+path to an RSS file is given by
+
-+/${RssGenOutputDirectory}/${ImplementationName}/${summary_context_id}/rss.xml +
${ImplementationName}
and
+${summary_context_id}
contain OS- and URL-friendly
+characters.
--
-
Datasource
and uses the information to build a new
- summary page. This generic and simple scheme can be used to
- dispatch different versions of the summary builder as well as to
- support extensibility via modules. Warning:
- This design expects the output of Datasource
to be
- reasonably small, as we will have to parse this list-of-lists to
- generate a summary.
+Summary context. A summary context is a content-containing
+domain which implements the summary service contract. A summary
+context is not identical to a package instance. For example, a single
+bboard package instance might contain 3 summary contexts, one for each
+of the forums in the instance.
-
+Service. A scheduled proc runs through all subscribed
+contexts, checking to see if the live summary is stale and also if the
+minimum "quiet time" has elapsed. If the conditions for rebuild are
+met for a context, the scheduled proc pulls out the context's summary
+data via Datasource
and uses the information to build a
+new summary page. This generic and simple scheme can be used to
+dispatch different versions of the summary builder as well as to
+support extensibility via modules. Warning:
+This design expects the output of Datasource
to be
+reasonably small, as we will have to parse this list-of-lists to
+generate a summary.
+