Index: openacs-4/packages/notifications/sql/postgresql/delivery-method-sc-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/sql/postgresql/Attic/delivery-method-sc-create.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/notifications/sql/postgresql/delivery-method-sc-create.sql 29 Jun 2002 01:27:50 -0000 1.1 +++ openacs-4/packages/notifications/sql/postgresql/delivery-method-sc-create.sql 1 Jul 2002 04:07:44 -0000 1.2 @@ -23,7 +23,7 @@ ''Notification Delivery Method'' ); - PEROFRM acs_sc_msg_type__new ( + PERFORM acs_sc_msg_type__new ( ''NotificationDeliveryMethod.Send.InputType'', ''to_user_id:integer,reply_object_id:integer,notification_type_id:integer,subject:string,content:string'' ); @@ -67,3 +67,6 @@ end; ' language 'plpgsql'; + +select inline_1(); +drop function inline_1(); \ No newline at end of file Index: openacs-4/packages/notifications/sql/postgresql/email-sc-impl-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/sql/postgresql/Attic/email-sc-impl-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/notifications/sql/postgresql/email-sc-impl-create.sql 1 Jul 2002 04:07:44 -0000 1.1 @@ -0,0 +1,67 @@ + +-- +-- The Notifications Package +-- +-- @author Ben Adida (ben@openforce.net) +-- @version $Id: email-sc-impl-create.sql,v 1.1 2002/07/01 04:07:44 ben Exp $ +-- +-- Copyright OpenForce, 2002. +-- +-- GNU GPL v2 +-- + +-- +-- The service contract implementation for email +-- + +create function inline_1() returns integer as ' +declare + impl_id integer; + foo integer; +begin + + impl_id := acs_sc_impl__new ( + ''NotificationDeliveryMethod'', + ''notification_email'', + ''notifications'' + ); + + foo := acs_sc_impl_alias__new ( + ''NotificationDeliveryMethod'', + ''notification_email'', + ''Send'', + ''notification::email::send'', + ''TCL'' + ); + + foo := acs_sc_impl_alias__new ( + ''NotificationDeliveryMethod'', + ''notification_email'', + ''ScanReplies'', + ''notification::email::scan_replies'', + ''TCL'' + ); + + perform acs_sc_binding__new ( + ''NotificationDeliveryMethod'', + ''notification_email'' + ); + + foo:= notification_delivery_method__new( + NULL, + impl_id, + ''email'', + ''Email'', + now(), + null, + null, + null + ); + + return(0); + +end; +' language 'plpgsql'; + +select inline_1(); +drop function inline_1(); Index: openacs-4/packages/notifications/sql/postgresql/notifications-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/sql/postgresql/notifications-create.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/notifications/sql/postgresql/notifications-create.sql 29 Jun 2002 01:27:50 -0000 1.3 +++ openacs-4/packages/notifications/sql/postgresql/notifications-create.sql 1 Jul 2002 04:07:44 -0000 1.4 @@ -20,8 +20,6 @@ \i notification-type-sc-create.sql --- WORK HERE!! (ben) - \i delivery-method-sc-create.sql \i notifications-init.sql \i email-sc-impl-create.sql Index: openacs-4/packages/notifications/sql/postgresql/notifications-init.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/sql/postgresql/notifications-init.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/notifications/sql/postgresql/notifications-init.sql 12 Jun 2002 13:53:13 -0000 1.2 +++ openacs-4/packages/notifications/sql/postgresql/notifications-init.sql 1 Jul 2002 04:07:44 -0000 1.3 @@ -43,15 +43,17 @@ null ); - perform notification_delivery_method__new ( - null, - ''email'', - ''Email'', - now(), - null, - null, - null - ); +-- This is now done by email-sc-impl-create.sql +-- +-- perform notification_delivery_method__new ( +-- null, +-- ''email'', +-- ''Email'', +-- now(), +-- null, +-- null, +-- null +-- ); return null; Index: openacs-4/packages/notifications/sql/postgresql/notifications-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/sql/postgresql/notifications-package-create.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/notifications/sql/postgresql/notifications-package-create.sql 25 Jun 2002 18:58:06 -0000 1.3 +++ openacs-4/packages/notifications/sql/postgresql/notifications-package-create.sql 1 Jul 2002 04:07:44 -0000 1.4 @@ -52,18 +52,19 @@ end; ' language 'plpgsql'; -select define_function_args ('notification_delivery_method__new','delivery_method_id,short_name,pretty_name,creation_date,creation_user,creation_ip,context_id'); +select define_function_args ('notification_delivery_method__new','delivery_method_id,sc_impl_id,short_name,pretty_name,creation_date,creation_user,creation_ip,context_id'); -create function notification_delivery_method__new (integer, varchar, varchar, timestamp, integer, varchar, integer) +create function notification_delivery_method__new (integer, integer, varchar, varchar, timestamp, integer, varchar, integer) returns integer as ' declare p_delivery_method_id alias for $1; - p_short_name alias for $2; - p_pretty_name alias for $3; - p_creation_date alias for $4; - p_creation_user alias for $5; - p_creation_ip alias for $6; - p_context_id alias for $7; + p_sc_impl_id alias for $2; + p_short_name alias for $3; + p_pretty_name alias for $4; + p_creation_date alias for $5; + p_creation_user alias for $6; + p_creation_ip alias for $7; + p_context_id alias for $8; v_delivery_method_id integer; begin v_delivery_method_id := acs_object__new( @@ -77,44 +78,15 @@ insert into notification_delivery_methods - (delivery_method_id, short_name, pretty_name) + (delivery_method_id, sc_impl_id, short_name, pretty_name) values - (v_delivery_method_id, p_short_name, p_pretty_name); + (v_delivery_method_id, p_sc_impl_id, p_short_name, p_pretty_name); return v_delivery_method_id; end; ' language 'plpgsql'; -create function notification_delivery_method__new (integer, integer, varchar, varchar, timestamp, integer, varchar, integer) -returns integer as ' -DECLARE - p_delivery_method_id alias for $1; - p_sc_impl_id alias for $2; - p_short_name alias for $3; - p_pretty_name alias for $4; - p_creation_date alias for $5; - p_creation_user alias for $6; - p_creation_ip alias for $7; - p_context_id alias for $8; - v_delivery_method_id integer; -BEGIN - v_delivery_method_id:= acs_object__new ( - p_delivery_method_id, - ''notification_delivery_method'', - p_creation_date, - p_creation_user, - p_creation_ip, - p_context_id); - - insert into notification_delivery_methods - (delivery_method_id, sc_impl_id, short_name, pretty_name) values - (v_delivery_method_id, p_sc_impl_id, p_short_name, p_pretty_name); - - return v_delivery_method_id; -END; -' language 'plpgsql'; - create function notification_delivery_method__delete(integer) returns integer as ' DECLARE