Index: openacs.org-dev/packages/forums/sql/postgresql/forums-sc-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs.org-dev/packages/forums/sql/postgresql/forums-sc-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs.org-dev/packages/forums/sql/postgresql/forums-sc-create.sql 8 Aug 2002 02:34:35 -0000 1.1 @@ -0,0 +1,57 @@ +-- forums service contracts for Search package +-- dave bauer +-- August 7, 2002 + +select acs_sc_impl__new( + 'FtsContentProvider', -- impl_contract_name + 'forums_message', -- impl_name + 'forums' -- impl_owner.name +); + +select acs_sc_impl_alias__new( + 'FtsContentProvider', -- impl_contract_name + 'forums_message', -- impl_name + 'datasource', -- impl_operation_name + 'forums::message::datasource', -- impl_alias + 'TCL' -- impl_pl +); + +select acs_sc_impl_alias__new( + 'FtsContentProvider', -- impl_contract_name + 'forums_message', -- impl_name + 'url', -- impl_operation_name + 'forums::message::url', -- impl_alias + 'TCL' -- impl_pl +); + +create function forums_message_search__itrg () +returns opaque as ' +begin + perform search_observer__enqueue(new.message_id,''INSERT''); + return new; +end;' language 'plpgsql'; + +create function forums_message_search__dtrg () +returns opaque as ' +begin + perform search_observer__enqueue(old.message_id,''DELETE''); + return old; +end;' language 'plpgsql'; + +create function forums_message_search__utrg () +returns opaque as ' +begin + perform search_observer__enqueue(old.message_id,''UPDATE''); + return old; +end;' language 'plpgsql'; + + +create trigger forums_message_search__itrg after insert on forums_messages +for each row execute procedure forums_message_search__itrg (); + +create trigger forums_message_search__dtrg after delete on forums_messages +for each row execute procedure forums_message_search__dtrg (); + +create trigger forums_message_search__utrg after update on forums_messages +for each row execute procedure forums_message_search__utrg (); + Index: openacs.org-dev/packages/forums/tcl/forums-sc-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs.org-dev/packages/forums/tcl/forums-sc-procs-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs.org-dev/packages/forums/tcl/forums-sc-procs-postgresql.xql 8 Aug 2002 02:34:35 -0000 1.1 @@ -0,0 +1,15 @@ + + + + postgresql7.1 + + + + select site_node__url(node_id) + from site_nodes + where object_id = (select package_id + from forums_forums + where forums_forums.forum_id = :forum_id) + + + \ No newline at end of file Index: openacs.org-dev/packages/forums/tcl/forums-sc-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs.org-dev/packages/forums/tcl/forums-sc-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs.org-dev/packages/forums/tcl/forums-sc-procs.tcl 8 Aug 2002 02:34:35 -0000 1.1 @@ -0,0 +1,38 @@ +ad_library { + + Forums Library - Search Service Contracts + + @creation-date 2002-08-07 + @author Dave Bauer + @cvs-id $Id: + +} + +namespace eval forums::message + +ad_proc datasource { message_id } { + @param message_id + @author dave@thedesignexperience.org + @creation_date 2002-08-07 + + returns a datasource for the search package + this is the content that will be indexed by the full text + search engine + +} { + forums::message::get -message_id $message_id -array message + return $message(content) +} + +ad_proc url { message_id } { + @param message_id + @author dave@thedesignexperience.org + @creation_date 2002-08-07 + + returns a url for a message to the search package + +} { + forums::message::get -message_id $message_id -array message + set forum_id $message(forum_id) + set url "[ad_url][db_string select_forums_package_url {}]" +} \ No newline at end of file