Index: openacs-4/packages/news/news.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/news.info,v diff -u -r1.4 -r1.5 --- openacs-4/packages/news/news.info 16 Oct 2001 18:18:36 -0000 1.4 +++ openacs-4/packages/news/news.info 25 Oct 2001 11:39:29 -0000 1.5 @@ -33,9 +33,12 @@ + + + @@ -106,12 +109,12 @@ - - - - - + + + + + Index: openacs-4/packages/news/sql/oracle/news-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/sql/oracle/news-create.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/news/sql/oracle/news-create.sql 16 Oct 2001 18:18:36 -0000 1.2 +++ openacs-4/packages/news/sql/oracle/news-create.sql 25 Oct 2001 11:39:29 -0000 1.3 @@ -210,7 +210,7 @@ default null, -- item_subtype in acs_object_types.object_type%TYPE - default 'content_item', + default 'content_revision', content_type in acs_object_types.object_type%TYPE default 'news', creation_date in acs_objects.creation_date%TYPE default sysdate, @@ -324,7 +324,7 @@ relation_tag in cr_child_rels.relation_tag%TYPE default null, -- item_subtype in acs_object_types.object_type%TYPE default - 'content_item', + 'content_revision', content_type in acs_object_types.object_type%TYPE default 'news', creation_date in acs_objects.creation_date%TYPE default sysdate, creation_ip in acs_objects.creation_ip%TYPE default null, Index: openacs-4/packages/news/sql/postgresql/news-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/sql/postgresql/news-create.sql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/news/sql/postgresql/news-create.sql 25 Oct 2001 11:03:31 -0000 1.5 +++ openacs-4/packages/news/sql/postgresql/news-create.sql 25 Oct 2001 11:39:29 -0000 1.6 @@ -886,3 +886,8 @@ -- plsql for searches: will be covered by site-wide search -- no additional code necessary for news items right now. + + +-- *** Search contract registration *** +-- +\i news-sc-create.sql Index: openacs-4/packages/news/sql/postgresql/news-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/sql/postgresql/news-drop.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/news/sql/postgresql/news-drop.sql 15 Oct 2001 13:41:03 -0000 1.1 +++ openacs-4/packages/news/sql/postgresql/news-drop.sql 25 Oct 2001 11:39:29 -0000 1.2 @@ -177,3 +177,8 @@ select inline_0 (); drop function inline_0 (); + + +-- *** Search contract de-registration *** +-- +\i news-sc-drop.sql Index: openacs-4/packages/news/sql/postgresql/news-sc-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/sql/postgresql/news-sc-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/news/sql/postgresql/news-sc-create.sql 25 Oct 2001 11:39:29 -0000 1.1 @@ -0,0 +1,30 @@ +-- /packages/news/sql/news-sc-create.sql +-- +-- @author Robert Locke (rlocke@infiniteinfo.com) +-- @created 2001-10-23 +-- @cvs-id $Id: news-sc-create.sql,v 1.1 2001/10/25 11:39:29 robertl Exp $ +-- +-- Adds search support to news module. +-- + +select acs_sc_impl__new( + 'FtsContentProvider', -- impl_contract_name + 'news', -- impl_name + 'news' -- impl_owner_name +); + +select acs_sc_impl_alias__new( + 'FtsContentProvider', -- impl_contract_name + 'news', -- impl_name + 'datasource', -- impl_operation_name + 'news__datasource', -- impl_alias + 'TCL' -- impl_pl +); + +select acs_sc_impl_alias__new( + 'FtsContentProvider', -- impl_contract_name + 'news', -- impl_name + 'url', -- impl_operation_name + 'news__url', -- impl_alias + 'TCL' -- impl_pl +); Index: openacs-4/packages/news/sql/postgresql/news-sc-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/sql/postgresql/news-sc-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/news/sql/postgresql/news-sc-drop.sql 25 Oct 2001 11:39:29 -0000 1.1 @@ -0,0 +1,13 @@ +-- /packages/news/sql/news-sc-drop.sql +-- +-- @author Robert Locke (rlocke@infiniteinfo.com) +-- @created 2001-10-23 +-- @cvs-id $Id: news-sc-drop.sql,v 1.1 2001/10/25 11:39:29 robertl Exp $ +-- +-- Removes search support from news module. +-- + +select acs_sc_impl__delete( + 'FtsContentProvider', -- impl_contract_name + 'news' -- impl_name +); Index: openacs-4/packages/news/tcl/news-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/tcl/news-procs-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/news/tcl/news-procs-oracle.xql 15 Oct 2001 13:41:03 -0000 1.1 +++ openacs-4/packages/news/tcl/news-procs-oracle.xql 25 Oct 2001 11:39:29 -0000 1.2 @@ -37,5 +37,16 @@ + + + + + select site_node.url(node_id) as url_stub + from site_nodes + where object_id=:package_id + + + + Index: openacs-4/packages/news/tcl/news-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/tcl/news-procs-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/news/tcl/news-procs-postgresql.xql 15 Oct 2001 13:41:03 -0000 1.1 +++ openacs-4/packages/news/tcl/news-procs-postgresql.xql 25 Oct 2001 11:39:29 -0000 1.2 @@ -32,5 +32,16 @@ + + + + + select site_node__url(node_id) as url_stub + from site_nodes + where object_id=:package_id + + + + Index: openacs-4/packages/news/tcl/news-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/tcl/news-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/news/tcl/news-procs.tcl 20 Apr 2001 20:51:14 -0000 1.1 +++ openacs-4/packages/news/tcl/news-procs.tcl 25 Oct 2001 11:39:29 -0000 1.2 @@ -67,5 +67,56 @@ } +ad_proc news_util_get_url { + package_key +} { + @author Robert Locke +} { + set package_id [apm_package_id_from_key $package_key] + db_0or1row get_url_stub " + select site_node__url(node_id) as url_stub + from site_nodes + where object_id=:package_id + " + + return $url_stub + +} + + +ad_proc news__datasource { + object_id +} { + We currently use the default content repository + datasource proc. + @author Robert Locke +} { + + array set datasource [acs_sc_call FtsContentProvider \ + datasource [list $object_id] content_revision] + + return [array get datasource] + +} + + +ad_proc news__url { + object_id +} { + @author Robert Locke +} { + + set url_stub [news_util_get_url news] + + db_1row get_item_id " + select item_id + from cr_revisions + where revision_id=:object_id + " + + set url "${url_stub}item?item_id=$item_id" + + return $url +} Index: openacs-4/packages/news/tcl/news-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/tcl/news-procs.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/news/tcl/news-procs.xql 25 Oct 2001 11:39:29 -0000 1.1 @@ -0,0 +1,15 @@ + + + + + + + + select item_id + from cr_revisions + where revision_id=:object_id + + + + + Index: openacs-4/packages/news/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/www/index.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/news/www/index.adp 15 Oct 2001 13:41:03 -0000 1.2 +++ openacs-4/packages/news/www/index.adp 25 Oct 2001 11:39:29 -0000 1.3 @@ -24,9 +24,8 @@ Search -
- - + search> +